ind2chr, chr2ind in string.jl need help #1039

Closed
JeffreySarnoff opened this Issue Jul 12, 2012 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

JeffreySarnoff commented Jul 12, 2012

the two are defined nearly the same way, chr2ind does not accept a char
something is not right with ind2chr, it returns the index given as an arg

julia> astr="astr"
"astr"

julia> (ind2chr(astr,2) , chr2ind(astr,'s'))
(2,'s')

Owner

JeffBezanson commented Jul 12, 2012

These functions convert between byte indexes and character indexes for multi-byte encodings like UTF-8. For ASCII strings they are the identity function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment