Java Unix Encode unixEncode(String string)

Here you can find the source of unixEncode(String string)

Description

unix Encode

License

Open Source License

Declaration

public static String unixEncode(String string) 

Method Source Code

//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;
    }
}

Related

  1. unixCommands(final String prefix)
  2. unixLineEndings(String text)
  3. UnixNameFilter(String Name)