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

Roger Keays is an artist, an engineer, and a student of life. He has no fixed address and has left footprints on 40-something different countries around the world. Roger is addicted to surfing. His other interests are music, psychology, languages, the proper use of semicolons, and finding good food.

Leave a Comment

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