Java String Sanitize sanitizeAppAlias(String appAlias)

Here you can find the source of sanitizeAppAlias(String appAlias)

Description

Make sure the app alias only has alphanumeric and common punctuation characters.

License

Apache License

Parameter

Parameter Description
appAlias appAlias

Return

sanitized app alias

Declaration

public static String sanitizeAppAlias(String appAlias) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**/*from  w  w w . ja  va  2s  .  co  m*/
     * Make sure the app alias only has alphanumeric and common punctuation characters.
     *
     * @param appAlias appAlias
     * @return sanitized app alias
     */
    public static String sanitizeAppAlias(String appAlias) {
        if (appAlias == null) {
            return null;
        } else {
            return appAlias.replaceAll("[^\\w\\-'\"\\s]", "");
        }
    }
}

Related

  1. sanitize(String string, boolean allowWhitespace)
  2. sanitize(String string, String spaceReplace)
  3. sanitize(String text)
  4. sanitize(String text)
  5. sanitize(String value)
  6. sanitizeAttribute(String value)
  7. sanitizeBranchName(String currentBranch)
  8. sanitizeBrowserName(String browserName)
  9. sanitizeChatMessage(String message)