java - Split String based on Uppercase and Numbers -
i split string
when uppercase letter or number found.
ive got working uppercase letters answers on other questions here:
string s = "hefneo2h3be1h"; string[] r = s.split("(?=\\p{upper})"); (int = 0; i<r.length; i++){ system.out.println(""+r[i]);
how can add numbers regex
string s split @ uppercase letters , numbers. thx advice.
public static void main(string args[]) { string s = "hefneo2h3be1h"; string[] r = s.split("(?=[a-z0-9])"); (int = 0; i<r.length; i++){ system.out.println(""+r[i]); } }
Comments
Post a Comment