Android Utililty Methods String Remove

List of utility methods to do String Remove

Description

The list of methods to do String Remove are organized into topic(s).

Method

Stringremove(String str, char remove)
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];
...
StringremoveCharacters(String x, char... cs)
remove Characters
for (char c : cs)
    x = x.replaceAll("[" + String.valueOf(c) + "]", "");
return x;
StringremoveCommaChar(String str)
remove Comma Char
return remove(str, ',');
StringremoveMinusChar(String str)
remove Minus Char
return remove(str, '-');
StringremovePhotoFromVCard(String vcard)
remove Photo From V Card
String line;
StringBuilder newVCard = new StringBuilder();
BufferedReader reader = new BufferedReader(new StringReader(vcard));
try {
    String photoLineStart = "PHOTO;ENCODING=";
    boolean removingPhotoLines = false;
    while ((line = reader.readLine()) != null) {
        if (line.startsWith(photoLineStart)) {
...
StringremoveQuotes(String ssid)
remove Quotes
if (ssid == null)
    return EMPTYSTRING;
else if (ssid.endsWith("\"") && ssid.startsWith("\"")) {
    try {
        ssid = ssid.substring(1, ssid.length() - 1);
    } catch (IndexOutOfBoundsException e) {
        return EMPTYSTRING;
return ssid;
StringremoveSpaces(String string)
remove Spaces
string = string.replaceAll("\\s+", "");
return string;
StringremoveSurplusSeparator(String str)
remove Surplus Separator
String sepStr = File.separator;
return str.replaceAll(sepStr + sepStr, sepStr);
voidremoveTableName(String tableName)
remove Table Name
mTableNames.remove(tableName);
StringremoveWhitespaces(String pString)
remove Whitespaces
return pString.replaceAll("[\\s-]*", "");