public static void main(String[] args) {
String s = "65234Markets6713Investments";
StringBuffer sb = new StringBuffer();
int pos = 1;
char[] ch = s.toCharArray();
for (int i = 0; i < ch.length; i++) {
if (Character.isDigit(ch[i])) {
if(pos!=1)
{
pos=1;
sb.append(',');
}
sb.append(ch[i]);
Please don't add a new question to somebody else's thread. That question probably merits a thread of its own, with a link to this thread if the patterns are similar.