Class StringUtils

java.lang.Object
net.dermetfan.utils.StringUtils

public class StringUtils extends Object
utility methods for operations on Strings
Since:
0.6.0
  • Constructor Details

    • StringUtils

      public StringUtils()
  • Method Details

    • toJavaIdentifier

      public static String toJavaIdentifier(String string)
      Parameters:
      string - the String to convert to a valid java identifier, as far as possible
    • isJavaIdentifierStart

      public static boolean isJavaIdentifierStart(char c)
      for GWT compatibility
      See Also:
    • isJavaIdentifierStart

      public static boolean isJavaIdentifierStart(int codePoint)
      for GWT compatibility
      See Also:
    • isJavaIdentifierPart

      public static boolean isJavaIdentifierPart(char c)
      for GWT compatibility
      See Also:
    • isJavaIdentifierPart

      public static boolean isJavaIdentifierPart(int codePoint)
      for GWT compatibility
      See Also:
    • replace

      public static String replace(int index, String replacement, String string)
      Parameters:
      index - the index of the character to replace
      replacement - the replacement for the character at the given index
      string - the String in which to replace
      Returns:
      a representation of the given String with the contents replaced
    • replace

      public static String replace(int index, char replacement, String string)
      See Also:
    • remove

      public static String remove(int beginIndex, int endIndex, String string)
      Parameters:
      beginIndex - the index of the first character to remove
      endIndex - the index at which to stop the removal
      string - the String from which to remove
      Returns:
      a representation of the given String with contents removed
    • remove

      public static String remove(int index, String string)
      See Also:
    • count

      public static int count(String target, String string, int beginIndex, int endIndex, boolean overlap)
      Parameters:
      overlap - if occurrences are allowed to overlap
      See Also:
    • count

      public static int count(String target, String string, int beginIndex, int endIndex)
      same as count without overlapping occurrences
      See Also:
    • count

      public static int count(String target, String string, boolean overlap)
      See Also:
    • count

      public static int count(String target, String string)
      same as count without overlapping occurrences
      See Also:
    • count

      public static int count(int c, String string, int beginIndex, int endIndex)
      Parameters:
      c - the character to count
      string - the String in which to count
      Returns:
      the number of occurrences of c in string in the range from beginIndex to endIndex
    • count

      public static int count(char c, String string, int beginIndex, int endIndex)
      See Also:
    • count

      public static int count(int c, String string)
      See Also:
    • count

      public static int count(char c, String string)
      See Also: