I need to replace an expression that occurs from time to time when parsing a file.
How would I replace every occurrence of \r\n****\r\n with nothing ""
So it would be a line return (\r\n) a 4 digit (numbers and letters) identifier then a line return(\r\n). Replace that with just blank (basically remove it).
Example would be \r\n1e25\r\n or
And then it would remove that whole thing from the string.
I'm not too good with regular expressions how would i go about that?
String has a function replaceAll() use that and it should take care of ur issue
ya i know... what would the regex be?
Something like that?
here it is , as simple as it can possibly get.
String d = "\r\n1e25\r\n\r\n2e26\r\n\r\n3e27\r\n\r\n4e28\r\n";
//there are 2 simple ways you can do it with, use split method or replaceAll
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)