Java tutorial
//package com.java2s; public class Main { public static String replaceBareLfWithCrlf(String str) { return str.replace("\r", "").replace("\n", "\r\n"); } }