Removing Line Feeds in Java

By , 22 January 2009

Removing Line Feeds in Java

This should be a fairly cross-platform way to remove line feeds from a string using Java:

string.replaceAll("[\r\n]", "")

Why do the smallest issues always take the longest to resolve?

Removing Line Feeds in Java

About Roger Keays

Removing Line Feeds in Java

I guess I'd call myself a problem solver. Either that, or I'm some sort of organic machine designed to convert oxygen into carbon dioxide. You could go either way on that. I'm into languages and stuff. I wrote a book. It's okay, I guess. What else? I like reading, swimming, eating, and playing music. Satisfied? Sheesh.

Leave a Comment

Please visit https://rogerkeays.com/blog/removing-line-feeds-in-java to add your comments.