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. Since he left Australia in 2009, he has been living as a digital nomad in over 40 different countries around the world. Roger is addicted to surfing. His other interests are music, psychology, languages, and finding good food.

Leave a Comment

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