Android String Replace replaceR(String str)

Here you can find the source of replaceR(String str)

Description

replace R

Declaration

public static String[] replaceR(String str) 

Method Source Code

//package com.java2s;

public class Main {
    public static String[] replaceR(String str) {
        String[] s = { "", "" };
        String strReturn = "";
        if (str.indexOf("\r\n") != -1) {
            s[1] = "\r\n";
            s[0] = str.replaceAll("\r\n", "");
            return s;
        } else if (str.indexOf("\n") != -1) {
            s[1] = "\n";
            s[0] = str.replaceAll("\n", "");
            return s;
        } else if (str.indexOf("\r") != -1) {
            s[1] = "\r";
            s[0] = str.replaceAll("\r", "");
        }//from   w  ww  .j a v  a  2  s  .  c o m
        s[0] = str;
        return s;
    }
}

Related

  1. replace(final String text, final String fromText, final String toText)
  2. replaceAll(String input, String searchStr, String replaceWithStr)
  3. replaceAllKanaWith(String text, String replacement)
  4. replaceAllKanjiWith(String text, String replacement)
  5. replaceKeyWords(StringBuilder sb, String[] keywords, String replaceStr)
  6. replaceSpace(String str)
  7. replaceStr(String number)
  8. replaceString(String s, Map replacement)
  9. replaceWords(String src, String targetValue, String newValue)