Class StringUtils

java.lang.Object
com.pocolifo.robobase.utils.StringUtils

public class StringUtils extends Object
  • Constructor Details

    • StringUtils

      public StringUtils()
  • Method Details

    • padLeft

      public static String padLeft(String str, char character, int amount)
      Adds n number of characters to the left of a string
      Parameters:
      str - the string to pad
      character - a character to pad with
      amount - amount of characters to pad with
      Returns:
      the new string with padding on the left
    • padRight

      public static String padRight(String str, char character, int amount)
      Adds n number of characters to the right of a string
      Parameters:
      str - the string to pad
      character - a character to pad with
      amount - amount of characters to pad with
      Returns:
      the new string with padding on the right
    • repeat

      public static String repeat(String str, int amount)
      Repeat a string n number of times
      Parameters:
      str - the string to repeat
      amount - amount of times to repeat
      Returns:
      a new string of str repeated amount times
    • escapeString

      public static String escapeString(String str)
      Escapes all escape characters in a string
      Parameters:
      str - the string to escape
      Returns:
      a new string made with str where all escape characters have been escaped