Class StringUtils


  • public final class StringUtils
    extends java.lang.Object
    String utilities
    • Method Summary

      Modifier and Type Method Description
      static int countCharOccurrences​(@NonNull java.lang.String haystack, char needle)
      Count the occurrences of a character in a string
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • countCharOccurrences

        public static int countCharOccurrences​(@NonNull java.lang.String haystack,
                                               char needle)
        Count the occurrences of a character in a string
        Parameters:
        haystack - The string to search in
        needle - The character to count for
        Returns:
        Number of occurrences