import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Enter name:\n");
String S = input.nextLine();
char[] string = S.toCharArray();
StringBuilder builder = new StringBuilder();
for(char c : string){
if(Character.isDigit(c){
System.out.println("Digits not allowed");
builder.append(c);}}
}
}
Comments
Leave a comment