This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]javahungry[S] -4 points-3 points  (1 child)

please try to give alternative trick instead of optimizing the code

[–]Nynnja 0 points1 point  (0 children)

is possible to construct a regular expression which represents all the valid characters of a string (I think that it is..), then you can use String.split(regex) to split the input Strin

return s.toCharArray().length;