Class UaTrimUtils


  • public class UaTrimUtils
    extends Object
    Utility methods for trimming specific characters from the start and/or end of strings.
    • Constructor Detail

      • UaTrimUtils

        public UaTrimUtils()
    • Method Detail

      • TrimEnd

        public static String TrimEnd​(String input,
                                     String charsToTrim)
        Removes all occurrences of the specified characters from the end of the string.
        Parameters:
        input - the input string
        charsToTrim - the characters to remove (used inside a regex character class)
        Returns:
        the trimmed string
      • TrimStart

        public static String TrimStart​(String input,
                                       String charsToTrim)
        Removes all occurrences of the specified characters from the start of the string.
        Parameters:
        input - the input string
        charsToTrim - the characters to remove (used inside a regex character class)
        Returns:
        the trimmed string
      • Trim

        public static String Trim​(String input,
                                  String charsToTrim)
        Removes all occurrences of the specified characters from both ends of the string.
        Parameters:
        input - the input string
        charsToTrim - the characters to remove (used inside a regex character class)
        Returns:
        the trimmed string