Android String End of Line Convert filterEnter(String str)

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

Description

filter Enter

Parameter

Parameter Description
str a parameter

Declaration

public static String filterEnter(String str) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from w ww  . j ava  2s  .com*/
     * @author : tiankang
     * @param str
     * @return
     */
    public static String filterEnter(String str) {
        int ind;
        StringBuffer sb = new StringBuffer();
        while ((ind = str.lastIndexOf("\n")) != -1) {
            sb.append(str.substring(0, ind));
            sb.append("\\n");
            sb.append(str.substring(ind + 1));
            str = sb.toString();
            sb.delete(0, str.length());
        }
        return str;
    }
}

Related

  1. convertEOLToLF(String input)
  2. rmvEnter(String input)
  3. removeEnd(String str, String remove)
  4. newLineToBr(String s)
  5. fold(String recipients)
  6. findEmptyLine(String s)
  7. deleteEmptyLine(String str)
  8. isS(char ch)