Count of camel case characters present in a given string | Java program for the above approach ; Function to count all the camelcase characters in the string S ; Stores the total count of camelcase characters ; Traverse the string S ; If ASCII value of character lies over the range [ 65 , 91 ] then increment the count ; Print the total count obtained ; Driver code
import java . io . * ; class GFG { static void countCamelCase ( String S ) { int count = 0 ; for ( int i = 0 ; i < S . length ( ) ; i ++ ) { if ( S . charAt ( i ) >= 65 && S . charAt ( i ) <= 91 ) { count ++ ; } } System . out . println ( count ) ; } public static void main ( String [ ] args ) { String S = " ckjkUUYII " ; countCamelCase ( S ) ; } }