Note also that using a range to loop through a string is not a good idea if 
it might contain unicode characters.

s = "a°sd2β2"
for i=1:length(s)
    print(s[i])  
end

LoadError: UnicodeError: invalid character index


Last time I checked there was still some functions in Base like findlast that 
had such issue.


The correct way to do it is to use start/done/next. That said it can become a 
bit tedious, when you have to reverse the string order first or so.

I found that using a vector of characters is sometimes an easy solution.



Reply via email to