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

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -