"count letters numbers and characters" Code Answer's
You're definitely familiar with the best coding language Whatever that developers use to develop their projects and they get all their queries like "count letters numbers and characters" answered properly. Developers are finding an appropriate answer about count letters numbers and characters related to the Whatever coding language. By visiting this online portal developers get answers concerning Whatever codes question like count letters numbers and characters. Enter your desired code related query in the search bar and get every piece of information about Whatever code related question on count letters numbers and characters.
count letters numbers and characters
public static String countLetter(String str){
String abc=str;
int a=0,b=0;
while(str.length()>0){
int i=0;
String ch=str.substring(i,i+1);
if(ch.matches(".*[a-zA-Z].*")){
a++;
}else if (ch.matches(".*[0-9].*")){
b++;
}
str=str.substring(i+1);
}
return abc + " has "+a+" letters "+b+" digit
and "+(abc.length()-(a+b))+" other characters ";
OR+++++++++++++++++++++++++++++++++
static void findSum(String str)
{
int total= str.length();
str = str.replaceAll("\\s", "");
int num =0;
int letter=0;
int i=0;
while(i<str.length()){
char ch = str.charAt(i);
// if current character is a digit
if (Character.isDigit(ch))
num ++;
// if current character is an alphabet
else {
letter++;
}
i++;
}
System.out.println(letter + " letters -> "+num +
" numbers -> "+ (total-letter-num) + " other chars");
}
All those coders who are working on the Whatever based application and are stuck on count letters numbers and characters can get a collection of related answers to their query. Programmers need to enter their query on count letters numbers and characters related to Whatever code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about count letters numbers and characters for the programmers working on Whatever code while coding their module. Coders are also allowed to rectify already present answers of count letters numbers and characters while working on the Whatever language code. Developers can add up suggestions if they deem fit any other answer relating to "count letters numbers and characters". Visit this developer's friendly online web community, CodeProZone, and get your queries like count letters numbers and characters resolved professionally and stay updated to the latest Whatever updates.