Class SmartStrings

java.lang.Object
org.basex.util.SmartStrings

public final class SmartStrings extends Object
This class provides convenience operations for smart string comparisons. If query strings and character are lower case, search will be case insensitive.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Method Details

    • startsWith

      public static boolean startsWith(String string, String sub)
      Checks if a string starts with the specified substring.
      Parameters:
      string - string
      sub - substring
      Returns:
      result of check
    • contains

      public static boolean contains(String string, String sub)
      Checks if a string contains the specified substring.
      Parameters:
      string - string
      sub - substring
      Returns:
      result of check
    • matches

      public static boolean matches(String string, String sub)
      Checks if all characters of the specified substring occur in a string in the given order.
      Parameters:
      string - string
      sub - substring
      Returns:
      result of check