KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a string and would like to simply replace all of the newlines in it with the string " --linebreak-- " . Would it be enough to just write: string = string.replaceAll("\n", " --linebreak-- "); I'm confused with the regex part of it. Do I need two slashes for the newline? Is this good enough?
Tags (comma-separated)
Save Edits
Cancel