I have one issue regarding string parsing.
String str = "jdaskks sms=<hello
hi wini>";
Here u can see, the new line character present in string.
I have written a program, which searches for sms= string
, then gets substring from < >
character. in which i check for new line character and replace it with '
'.
But i have issue, when i get substring . i replace it. but how to change this in original string str, as i can see change in substring not in original string.
Help is appreciated.
str.substring(j,str.indexOf('>',j+1)).replaceAll("\n", "#10");
here j is index of '<'
If i assign this string, i will get the substring with replace char, not original string with replaced new line character