Class Strings

java.lang.Object
pascal.taie.util.Strings

public final class Strings extends Object
Static utility methods for String.
  • Method Details

    • capitalize

      public static String capitalize(String str)
      Capitalizes a String, changing the first letter to upper case as per Character.toUpperCase(char). No other letters are changed.
      Parameters:
      str - the String to capitalize
      Returns:
      the capitalized String
    • escape

      public static String escape(String str)
      Escapes special characters in a given string by replacing them with their corresponding escape sequences. If the input string is null or empty, the method returns it unchanged.
      Parameters:
      str - the input string to be escaped
      Returns:
      a string with special characters replaced by their corresponding escape sequences, or the original string if it is null or empty