Class Strings

java.lang.Object
org.loboevolution.common.Strings

public final class Strings extends Object
The Class Strings.
  • Field Details

    • EMPTY_ARRAY

      public static final String[] EMPTY_ARRAY
      The Constant EMPTY_ARRAY.
  • Method Details

    • countChars

      public static int countChars(String text, char ch)
      Count chars.
      Parameters:
      text - the text
      ch - the ch
      Returns:
      the int
    • texMeasure

      public static Rectangle2D texMeasure(String text, Font font)
      tex measure
      Parameters:
      text - a String object.
      font - a Font object.
      Returns:
      a Rectangle2D object.
    • isBlank

      public static boolean isBlank(String text)
      Checks if is blank.
      Parameters:
      text - the text
      Returns:
      true, if is blank
    • isCssBlank

      public static boolean isCssBlank(String text)
    • linearize

      public static String linearize(String text)
      Linearize string.
      Parameters:
      text - the text
      Returns:
      string
    • isNotBlank

      public static boolean isNotBlank(String text)
      Checks if is not blank.
      Parameters:
      text - the text
      Returns:
      true, if is not blank
    • isCssNotBlank

      public static boolean isCssNotBlank(String text)
    • isStringBuilderNotBlack

      public static boolean isStringBuilderNotBlack(StringBuilder text)
    • containsIgnoreCase

      public static boolean containsIgnoreCase(String text, String text1)
    • startsWithIgnoreCase

      public static boolean startsWithIgnoreCase(String text, String text1)
    • endsWithIgnoreCase

      public static boolean endsWithIgnoreCase(String text, String text1)
    • splitIgnoreCase

      public static String[] splitIgnoreCase(String text, String text1)
    • isNumeric

      public static boolean isNumeric(String keyCode)

      isNumeric.

      Parameters:
      keyCode - a String object.
      Returns:
      a boolean.
    • split

      public static String[] split(String phrase)
      Split.
      Parameters:
      phrase - the phrase
      Returns:
      the string[]
    • splitUsingTokenizer

      public static String[] splitUsingTokenizer(String subject, String delimiters)

      splitUsingTokenizer.

      Parameters:
      subject - a String object.
      delimiters - a String object.
      Returns:
      an array of String objects.
    • strictHtmlEncode

      public static String strictHtmlEncode(String rawText, boolean quotes)
      Strict html encode.
      Parameters:
      rawText - the raw text
      quotes - the quotes
      Returns:
      the string
    • trimForAlphaNumDash

      public static String trimForAlphaNumDash(String rawText)
      Trim for alpha num dash.
      Parameters:
      rawText - the raw text
      Returns:
      the string
    • unquote

      public static String unquote(String text)
      Unquote.
      Parameters:
      text - the text
      Returns:
      the string
    • unquoteSingle

      public static String unquoteSingle(String text)

      unquoteSingle.

      Parameters:
      text - a String object.
      Returns:
      a String object.
    • containsWords

      public static boolean containsWords(String inputString, String[] items)

      containsWords.

      Parameters:
      inputString - a String object.
      items - an array of String objects.
      Returns:
      a boolean.
    • hash

      public static String hash(String password, byte[] salt) throws Exception

      hash.

      Parameters:
      password - a String object.
      salt - an array of
      invalid reference
      byte
      objects.
      Returns:
      a String object.
      Throws:
      Exception - if any.
    • randomAlphaNumeric

      public static String randomAlphaNumeric(int count)

      randomAlphaNumeric.

      Parameters:
      count - a Integer object.
      Returns:
      a String object.
    • isValidTag

      public static boolean isValidTag(String name, boolean isXml)
    • isXMLIdentifier

      public static boolean isXMLIdentifier(String str)