public static int searchIgnoreCase ( CharSequence chars , char c ) { int count = 0 ; char cl = Character . toLowerCase ( c ) ; for ( int i = 0 ; i < chars . length ( ) ; i ++ ) { if ( Character . toLowerCase ( chars . charAt ( i ) ) == cl ) { count ++ ; } } return count ; }
Returns the number of times the specified character was found in the target string or 0 if there is no specified character . When searching for the specified character it is not case - sensitive .