Skip to content
Advertisement

Removing backslash and newline character within one column

I’m getting text string html along with backslash and newline character. I can easily remove html tags using .replaceAll("<[^>]*>","") but still and new line character still exists. So, again i tried to replaceAll("\r\n|\r|\n","") but removing end of line characters.

Input String:

JavaScript

Expected output string:

JavaScript

Advertisement

Answer

it’s a strange request and i’d fix it in place where you are generating input text

however seems each new-line that you want to remove prepended with a backslash

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement