Java String Sanitize sanitizeTag(String s)

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

Description

sanitize Tag

License

Apache License

Declaration

public static String sanitizeTag(String s) 

Method Source Code

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

public class Main {
    public static final int MAX_TAG_LENGTH = 55;

    public static String sanitizeTag(String s) {
        // if > 55 chars, assume max entropy is at the end (like a class name).
        if (s.length() > MAX_TAG_LENGTH) {
            s = s.substring(s.length() - MAX_TAG_LENGTH);
        }//from   w w  w.j  av  a  2s.  co  m
        return s;
    }
}

Related

  1. sanitizeString(String str)
  2. sanitizeStringAsLiteral(String literal)
  3. sanitizeStringForXPath(String text)
  4. sanitizeStringLiteral(String inputString)
  5. sanitizeSuiteName(String name)
  6. sanitizeTextAsDomId(final String text)
  7. sanitizeTimezones(String s)
  8. sanitizeTokenString(final String tokenString)
  9. sanitizeToLineFeed(CharSequence string)