Lets Solve Camel Case Program In Java
package demo;
public class CamelCase {
public static void main(String[] args) {
String str = "saveChangesInTheEditor";
int count = 1;
for (int i = 0; i < str.length(); i++) {
int a = str.charAt(i);
if (a >= 65 && a <= 90) {
count += 1;
}
}
System.out.println(count);
}
}
Comments
Post a Comment