Android String Remove removeCommaChar(String str)

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

Description

remove Comma Char

Declaration

public static String removeCommaChar(String str) 

Method Source Code

//package com.java2s;

public class Main {

    public static String removeCommaChar(String str) {
        return remove(str, ',');
    }// w  w w . j a va2s. c  om

    public static String remove(String str, char remove) {
        if (isEmpty(str) || str.indexOf(remove) == -1) {
            return str;
        }
        char[] chars = str.toCharArray();
        int pos = 0;
        for (int i = 0; i < chars.length; i++) {
            if (chars[i] != remove) {
                chars[pos++] = chars[i];
            }
        }
        return new String(chars, 0, pos);
    }

    public static boolean isEmpty(String str) {
        return str == null || str.length() == 0;
    }

    public static int indexOf(String str, String searchStr) {
        if (str == null || searchStr == null) {
            return -1;
        }
        return str.indexOf(searchStr);
    }
}

Related

  1. rmvSpecial(String baseStr)
  2. removeBlanks(String content)
  3. rmvBlankLines(String input)
  4. remove(String str, char remove)
  5. removeCharacters(String x, char... cs)
  6. removeMinusChar(String str)
  7. removePhotoFromVCard(String vcard)
  8. removeQuotes(String ssid)
  9. removeSpaces(String string)