Class UnicodeString

java.lang.Object
com.webfirmframework.wffweb.lang.UnicodeString

public final class UnicodeString extends Object
An immutable class for unicode based string manipulation.
Since:
3.0.15
  • Constructor Details

    • UnicodeString

      public UnicodeString(String s)
    • UnicodeString

      public UnicodeString(int[] codePoints)
  • Method Details

    • length

      public int length()
      Returns:
      the number of unicode chars contained in it or -1 if it is a null UnicodeString.
    • codePoints

      public int[] codePoints()
    • newString

      public String newString()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • isBlank

      public boolean isBlank()
      Returns:
      true if it contains only whitespace otherwise false.
      Since:
      3.0.15
    • substring

      public UnicodeString substring(int startIndex, int endIndex)
      Parameters:
      startIndex -
      endIndex - exclusive
      Returns:
      the substring
    • substring

      public UnicodeString substring(int startIndex)
      Parameters:
      startIndex -
      Returns:
      the substring
    • indexOf

      public int indexOf(UnicodeString uc)
      Parameters:
      uc - the UnicodeString
      Returns:
      the index
      Since:
      3.0.15
    • indexOf

      public int indexOf(int c)
      Parameters:
      c - the unicode char code
      Returns:
      the index
      Since:
      3.0.15
    • lastIndexOf

      public int lastIndexOf(UnicodeString uc)
      Parameters:
      uc - the UnicodeString
      Returns:
      the index from last
      Since:
      3.0.15
    • lastIndexOf

      public int lastIndexOf(int c)
      Parameters:
      c - c the unicode char code
      Returns:
      the index from last
      Since:
      3.0.15
    • replace

      public UnicodeString replace(String forString, String with)
      Parameters:
      forString - the string for which the replacement to be done.
      with - the matching to be replaced with this value.
      Returns:
      the processed string
      Since:
      3.0.15
    • replace

      public UnicodeString replace(UnicodeString forString, UnicodeString with)
      Parameters:
      forString - the string for which the replacement to be done.
      with - the matching to be replaced with this value.
      Returns:
      the processed string
      Since:
      3.0.15
    • startsWith

      public boolean startsWith(UnicodeString us)
      Parameters:
      us -
      Returns:
      true if this UnicodeString starts with the given UnicodeString.
      Since:
      3.0.15
    • endsWith

      public boolean endsWith(UnicodeString us)
      Parameters:
      us -
      Returns:
      true if this UnicodeString ends with the given UnicodeString.
      Since:
      3.0.15
    • strip

      public UnicodeString strip()
      Returns:
      the stripped UnicodeString
      Since:
      3.0.15
    • split

      public UnicodeString[] split(int delim)
      Parameters:
      delim - to by which the given string to be split. It is the code point value of char.
      Returns:
      the array of UnicodeStrings split by the given unicode char code.
      Since:
      3.0.15
    • splitByAny

      public UnicodeString[] splitByAny(int[] delims)
      Parameters:
      delims - to by which the given string to be split. It is the code point values of chars, i.e. unicode values.
      Returns:
      the array of UnicodeStrings split by the given chars.
      Since:
      3.0.15