Skip to content

Commit 327c39c

Browse files
committed
Add vector indexing of ASCIIString
With this commit, now you can do this: s = "swap me" indx = [4,3,6] s[indx]
1 parent 8574723 commit 327c39c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

jl/ascii.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ref(s::ASCIIString, i::Int) = char(s.data[i])
99
## overload methods for efficiency ##
1010

1111
ref(s::ASCIIString, r::Range1{Int}) = ASCIIString(ref(s.data,r))
12+
ref(s::ASCIIString, indx::Array{Int,1}) = ASCIIString(s.data[indx])
1213
strchr(s::ASCIIString, c::Char) = c < 0x80 ? memchr(s.data, c) : 0
1314
strcat(a::ASCIIString, b::ASCIIString, c::ASCIIString...) = ASCIIString(memcat(a,b,c...))
1415

0 commit comments

Comments
 (0)