0

All this regex stuff has me really confused. How could I just replace all the occurrences of "\\" in a string with "\n"?

2
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by Kob0724
0
String newString = oldString.replace("\\","\n");

That kind of works. The problem with it though is that it also replaces instances of "\" with a "\n". I only want instances of "\\" to be replaced with a "\n".

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.