Java (Regex?) split string between number/letter combination

前端 未结 5 1960
甜味超标
甜味超标 2021-01-05 08:44

I\'ve been looking through pages and pages of Google results but haven\'t come across anything that could help me.

What I\'m trying to do is split a string like

5条回答
  •  执念已碎
    2021-01-05 09:14

    String myText = "Bananas22Apples496Pears3";
    System.out.println(myText.replaceAll("([A-Za-z]+)([0-9]+)", "$1:$2,"));
    

提交回复
热议问题