Java tutorial
//package com.java2s; public class Main { /** * Convert to LF * @param text * @return */ public static String convertToLf(String text) { String repCrlf = text.replaceAll("\r\n", "\n"); String repLf = repCrlf.replaceAll("\r", "\n"); return repLf; } }