Here you can find the source of unixEncode(String string)
public static String unixEncode(String string)
//package com.java2s; public class Main { private static final String CR = "\r"; private static final String LF = "\n"; public static String unixEncode(String string) { return changeNewlines(string, LF); }/*from www . j a v a 2 s .co m*/ private static String changeNewlines(String string, String newline) { string = string.replaceAll(CR, ""); string = string.replaceAll(LF, newline); return string; } }