Skip to content

Commit

Permalink
fixed which, starts, and ends doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
cecoeco committed May 15, 2024
1 parent e8ccd77 commit 0cb62a9
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions src/strings_docstrings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -464,16 +464,16 @@ Examples
```jldoctest
julia> str_starts(["apple", "banana", "pear", "pineapple"], r"^p") # [false, false, true, true]
4-element Vector{Bool}:
false
false
true
true
0
0
1
1
julia> str_starts(["apple", "banana", "pear", "pineapple"], r"^p", negate=true) # [true, true, false, false]
4-element Vector{Bool}:
true
true
false
false
1
1
0
0
```
"""

Expand All @@ -495,16 +495,16 @@ Examples
```jldoctest
julia> str_ends(["apple", "banana", "pear", "pineapple"], r"e\$") # [true, false, false, true]
4-element Vector{Bool}:
true
false
false
true
1
0
0
1
julia> str_ends(["apple", "banana", "pear", "pineapple"], r"e\$", negate=true) # [false, true, true, false]
4-element Vector{Bool}:
false
true
true
false
0
1
1
0
```
"""

Expand All @@ -526,13 +526,11 @@ An integer vector containing indices of matching strings.
```jldoctest
julia> str_which(["apple", "banana", "pear", "pineapple"], r"a") # [1, 3]
2-element Vector{Int64}:
1
3
julia> str_which(["apple", "banana", "pear", "pineapple"], r"a", negate=true) # [2, 4]
2-element Vector{Int64}:
2
4
1
3
julia> str_which(["apple", "banana", "pear", "pineapple"], r"a", negate=true) # []
Int64[]
julia> str_which(["apple", "banana", "pear", "pineapple"], "a", negate=true) # []
0-element Vector{Int64}:
Int64[]
```
"""

0 comments on commit 0cb62a9

Please sign in to comment.