Class TLcdStringUtil

java.lang.Object
com.luciad.util.TLcdStringUtil

public final class TLcdStringUtil extends Object
This class provides convenience methods for String tests and operations.
  • Constructor Details

    • TLcdStringUtil

      public TLcdStringUtil()
  • Method Details

    • startsWithIgnoreCase

      public static boolean startsWithIgnoreCase(String aString, String aPrefix)
      Returns whether the given string starts with the given prefix, ignoring the case.
      See Also:
    • startsWithIgnoreCase

      public static boolean startsWithIgnoreCase(String aString, String aPrefix, int aStringOffset)
      Returns whether the given string starts with the given prefix, beginning at a specified index, and ignoring the case.
      See Also:
    • endsWithIgnoreCase

      public static boolean endsWithIgnoreCase(String aString, String aSuffix)
      Returns whether the given string starts with the given prefix, ignoring the case.
      See Also:
    • containsIgnoreCase

      public static boolean containsIgnoreCase(String aString, String aSubstring)
      Returns whether the given string contains the given substring, ignoring the case.
      Parameters:
      aString - the string that potentially contains aSubstring
      aSubstring - the substring to look for
      Returns:
      true if this string contains aSubstring, false otherwise
      Since:
      2021.1
      See Also:
    • indexOfIgnoreCase

      public static int indexOfIgnoreCase(String aString, String aSubstring)
      Returns the index within the given string of the first occurrence of the specified substring, ignoring the case.
      Parameters:
      aString - the string that potentially contains aSubstring
      aSubstring - the substring to look for
      Returns:
      the index of the first occurrence of the specified substring, or -1 if there is no such occurrence.
      Since:
      2021.1
      See Also:
    • replacePrefixPreserveCase

      public static String replacePrefixPreserveCase(String aString, int aPrefixLength, String aNewPrefix)
      Returns the given string, with its prefix replaced by a new prefix, preserving the case of the prefix. The case can be all lowercase, all uppercase, or unchanged.
    • replaceSuffixPreserveCase

      public static String replaceSuffixPreserveCase(String aString, int aSuffixLength, String aNewSuffix)
      Returns the given string, with its suffix replaced by a new suffix, preserving the case of the suffix. The case can be all lowercase, all uppercase, or unchanged.
    • toMatchingCase

      public static String toMatchingCase(String aString, String aCaseString)
      Returns the given string, changing its case to match the case of the given case string. The case can be all lowercase, all uppercase, or unchanged.
    • capitalizeFirstCharacter

      public static String capitalizeFirstCharacter(String aString)
      Returns a string containing all characters of the given string, but the first character will be uppercase.
      Parameters:
      aString - the input string
      Returns:
      a copy of the given string, with the first character capitalized