Remove all spaces and replace for value.

@param value The input String
@return String without spaces
549296
public static String removeSpaces(final String value) {
        validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        return value.replaceAll("\\s", "");
    }
245013
public static String trimAllWhitespace(final String str) {
    if (!StringUtils.hasLength(str)) {
      return str;
    }

    final int len = str.length();
    final StringBuilder sb = new StringBuilder(str.length());
    for (int i = 0; i < len; i++) {
      final char c = str.charAt(i);
      if (!Character.isWhitespace(c)) {
        sb.append(c);
      }
    }
    return sb.toString();
  }
644379
private static String addSpaces(String value) {
        final int length = value.length();
        final int lastPossibleBlock = length - 4;
        final StringBuilder sb = new StringBuilder(length + (length - 1) / 4);
        int i;
        for (i = 0; i < lastPossibleBlock; i += 4) {
            sb.append(value, i, i + 4);
            sb.append(' ');
        }
        sb.append(value, i, length);
        return sb.toString();
    }
826075
private String getNamespaceValue(final String value) {
        if (value == null || value.contains(":") || value.equals("text")) {
            return value;
        } else {
            return getCurrentNamespace() + ":" + value;
        }
    }
43772
public static String spacesOptional(final String input) {
		String output;
		output = input.replaceAll("\\s", "\\\\s?");
		return output;
	}
1097758
public static String escape(String value) {
        for (int i = 0; i < value.length(); i++) {
            if (isEscapingChar(value.charAt(i))) {
                return doEscape(value.getBytes(StandardCharsets.UTF_8), i);
            }
        }
        return value;
    }
821044
@Nonnull
  public static String trimLeft(@Nonnull final String value) {
    final StringBuilder result = new StringBuilder(assertNotNull(value).length());
    int index = 0;
    for(;index<value.length();index++){
      final char chr = value.charAt(index);
      if (!(Character.isWhitespace(chr) || Character.isISOControl(chr))) break;
    }
    if (index<value.length()) {
      result.append(value, index, value.length());
    }
    return result.toString();
  }
425855
public static String startWithSpace(String value) {
		if (value.length() > 0 && (value.charAt(0) != ' ' && value.charAt(0) != '\t')) {
			return " " + value;
		}

		return value;
	}
1084048
public static String toStudlyCase(final String value) {
        validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        String[] words = collapseWhitespace(value.trim()).split("\\s*(_|-|\\s)\\s*");
        return Arrays.stream(words).filter(w -> !w.trim().isEmpty()).map(Strman::upperFirst).collect(joining());
    }
937341
public static String getExactlyValue(final String value) {
        return null == value ? null : CharMatcher.anyOf("[]`'\"").removeFrom(value);
    }
49227
public static String shellifyOptionValue(String value)
   {
      return COLONS.matcher(WHITESPACES.matcher(value.trim()).replaceAll("_")).replaceAll("").toUpperCase();
   }
1313151
static List<Token> tokenize(final String value) {
		final List<Token> tokens = new ArrayList<>();

		char pc = '\0';
		int pos = 0;
		final StringBuilder token = new StringBuilder();
		for (int i = 0; i < value.length(); ++i) {
			final char c = value.charAt(i);

			if (isTokenSeparator(c) && pc != ESCAPE_CHAR) {
				tokens.add(new Token(unescape(token.toString()), pos));
				tokens.add(new Token(Character.toString(c), i));
				token.setLength(0);
				pos = i;
			} else {
				token.append(c);
			}

			pc = c;
		}

		if (token.length() > 0) {
			tokens.add(new Token(unescape(token.toString()), pos));
		}

		return tokens;
	}
981908
public static String escapeString(String value, boolean noBackslashEscapes) {
    if (!value.contains("'")) {
      if (noBackslashEscapes) {
        return value;
      }
      if (!value.contains("\\")) {
        return value;
      }
    }
    String escaped = value.replace("'", "''");
    if (noBackslashEscapes) {
      return escaped;
    }
    return escaped.replace("\\", "\\\\");
  }
278596
public String clean(String value) {
    String orig = value;
    
    // check if there's a + before the first digit
    boolean initialplus = findPlus(value);
    
    // remove everything but digits
    value = sub.clean(value);
    if (value == null)
      return null;

    // check for initial '00'
    boolean zerozero = !initialplus && value.startsWith("00");
    if (zerozero)
      value = value.substring(2); // strip off the zeros

    // look for country code
    CountryCode ccode = findCountryCode(value);
    if (ccode == null) {
      // no country code, let's do what little we can
      if (initialplus || zerozero)
        return orig; // this number is messed up. dare not touch
      return value;

    } else {
      value = value.substring(ccode.getPrefix().length()); // strip off ccode
      if (ccode.getStripZero() && value.startsWith("0"))
        value = value.substring(1); // strip the zero

      if (ccode.isRightFormat(value))
        return "+" + ccode.getPrefix() + " " + value;
      else
        return orig; // don't dare touch this
    }
  }
267933
public static String escapeHtmlAttributeNospace(SoyValue value) {
    value = normalizeNull(value);
    if (isSanitizedContentOfKind(value, SanitizedContent.ContentKind.HTML)) {
      // |escapeHtmlAttributeNospace should only be used on attribute values that cannot have tags.
      return stripHtmlTags(value.coerceToString(), null, false);
    }
    return escapeHtmlAttributeNospace(value.coerceToString());
  }
60916
public static String collapseWhitespace(final String value) {
        validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        return value.trim().replaceAll("\\s\\s+", " ");
    }
480911
public static String removeBackslashEscape(String value) {
        StringBuffer sb = new StringBuffer();
        int i, n = value.length();
        char ch;
        boolean lastIsEscape = false;
        for (i=0; i<n; i++) {
            ch = value.charAt(i);
            if (lastIsEscape) {
                sb.append(ch);
                lastIsEscape = false;
            } else {
                if (ch=='\\') lastIsEscape = true;
                else sb.append(ch);
            }
        }
        return sb.toString();
    }