Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import static java.lang.Character.*;
- public class jman{
- public static void main(String []args){
- Scanner scan = new Scanner(System.in);
- System.out.print("Input String here: ");
- String str =scan.nextLine();
- int countLetters=0;
- for(int i=0; i<str.length(); i++){
- if(isLetter(str.charAt(i))){
- countLetters++;
- }
- }
- System.out.println("The String "+str+" has: "+countLetters);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement