Java String Sanitize sanitizeString(String s)

Here you can find the source of sanitizeString(String s)

Description

sanitize String

License

Open Source License

Declaration

public static String sanitizeString(String s) 

Method Source Code

//package com.java2s;

public class Main {
    public static String sanitizeString(String s) {
        StringBuilder sb = new StringBuilder();
        for (char c : s.toCharArray()) {
            if (c < 0x20) {
                sb.append(" ");
            } else {
                sb.append(c);//  w  w  w. j  a  v a2s. c  om
            }
        }
        return sb.toString().trim();
    }
}

Related

  1. sanitizeSingleQuotesInAlbumItemValues(String value)
  2. sanitizeString(final String s)
  3. sanitizeString(String dirtyString)
  4. sanitizeString(String input)
  5. sanitizeString(String s)
  6. sanitizeString(String s)
  7. sanitizeString(String str)
  8. sanitizeStringAsLiteral(String literal)
  9. sanitizeStringForXPath(String text)