Class StringUtils

    • Method Detail

      • countCharOccurrences

        public static int countCharOccurrences​(@NonNull 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