The "{1,1}" specifies only 1 character. If you want 2 or 3 characters you would change it to "{2,3}". This method is quicker than substr.
When you split on nothing(//), it splits each character into it's own element of the resulting list. I'm not sure how efficient this is compared to the other methods, but this is an option.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.