Java 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

StringremovePostfixedNewline(String s)
remove Postfixed Newline
if (isEmpty(s)) {
    return s;
} else {
    return s.endsWith("\n") ? s.substring(0, s.length() - 1) : s;
voidremoveProperty(String name)
remove Property
_globals.remove(name);
voidremovePropertyNameModifier(String name)
Removes a property name modifier.
propertyNameModifiers.remove(name);
StringremovePunctuation(String str)
remove Punctuation
char[] chs = str.toCharArray();
ArrayList<Character> list = new ArrayList<Character>();
for (int i = 0; i < chs.length; i++) {
    if (Character.getType(chs[i]) == 5) {
        list.add(chs[i]);
char[] newchs = new char[list.size()];
...
StringremovePunctuation(String value)
remove Punctuation
return removePunctuation(value, null);
voidremoveRecursive(Object json, String keyToRemove)
Removes a key recursively from anywhere in a JSON document.
if ((json == null) || (keyToRemove == null)) {
    return;
if (json instanceof Map) {
    @SuppressWarnings("unchecked")
    Map<String, Object> jsonMap = (Map<String, Object>) json;
    if (jsonMap.containsKey(keyToRemove)) {
        jsonMap.remove(keyToRemove);
...
StringremoveSomeOne(String words, int count)
remove Some One
String[] word = words.split("\\^");
int wordsLength = word.length;
if (count < wordsLength) {
    System.arraycopy(word, count + 1, word, count, wordsLength - 1 - count);
    String[] newWords = Arrays.copyOf(word, wordsLength - 1);
    StringBuilder sb = new StringBuilder();
    for (String newWord : newWords) {
        sb.append(newWord).append("^");
...
StringremoveSpaces(String orig)
xxx yyy zzz becomes xxxyyyzzz.
StringTokenizer st = new StringTokenizer(orig, " ");
StringBuffer sb = new StringBuffer(orig.length());
while (st.hasMoreTokens()) {
    sb.append(st.nextToken());
if (sb.toString().length() == 0)
    return orig;
return sb.toString();
...
ListremoveSpecialChars(final String word)
remove Special Chars
if (word.length() == 0)
    return null;
final List<String> tokenList = new ArrayList<String>();
String token = "";
for (int index = 0; index < word.length(); index++) {
    char ch = word.charAt(index);
    if (('a' <= ch && ch <= 'z') || ('0' <= ch && ch <= '9'))
        token += ch;
...
StringremoveSpecialCharsForSQLRegExp(String _s)
remove Special Chars For SQL Reg Exp
String _r = "";
for (int i = 0, m = _s.length(); i < m; i++) {
    char c = _s.charAt(i);
    if (false == alReplacements.contains("" + c)) {
        _r = _r.concat("" + c);
return _r;
...