answersLogoWhite

0


Best Answer

public int getStringLength(String val) {

return val.length();

}

There is an inbuilt functionality in strings that counts the number of alphabets in a string called length()

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What program can be written to count the number of alphanumerics in a string?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How to write A Java program to print number of digits in a given number?

One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.


How do you write programs for String Reversal Palindrome check?

Copy and reverse the string. If the reversed string is equal to the original string, the string is a palindrome, otherwise it is not. When working with strings that hold natural language phrases (including punctuation, whitespace and so on) we must remove all the non-alphanumerics and convert the remainder to a common case, such as lower-case, prior to copying and reversing the string.


How to write a program in python to print the reverse of a number?

In python, type the following into a document. NOTE: Sentences following a # symbol are comments, and are not necessary for the program to run. #!/usr/bin/python #This program takes a input from a user and reverses it. number = input("Type a number: ") #This takes input from a user. a = len(number) #This finds the length of the number reverse = "" #This sets the variable reverse to an empty string. for i in number: a = a-1 #The places in a string start from 0. The last value will be the length minus 1.reverse = reverse + number[a] #Makes the number's last digit the new string's first. print("The reverse of", number, "is", reverse + ".") #prints the resulting string. This program will take any sequence of characters and reverse them. The final value is a string, but if an integer is needed, one needs only to add the line reverse = int(reverse) above the print statement. However, this will stop the program from being able to reverse strings, as it is not possible to convert a string to an integer if it is not a number.


Write a Program to convert decimal number into hexadecimal no without using function and string?

This is not a question.


Write a program to implement the various operations on string such as length of string concatenation reverse of a string copy of a string to another in VB?

what is string


C plus plus program to perform string manipulation?

You do not need to program string manipulation as it is already part of the standard library. See std::string and std::wstring.


How do you write a program using function that counts the number of vowels in a string in java language?

Use text-editor notepad++


What is the term used for a string that appears in the actual code of a program?

string-literal


What term is used for a string that appears in the actual code of a program?

string-literal


What is the use of Reverse String in C program?

The use of the reverse string in C program is used to reverse the letters in the string. An example would be reverse me would be reversed to em esrever.


A C program to print the number of words from given String?

/*We can calculate this with a lot of methods I'll explain only one of them */ *str = "abcd"; // this is a input string printf("%d", strlen(str));


Write a program that converts a decimal number to crossponding string .Decimal Number is accepted as command line input at the time of execution?

#include #include using std::cout;using std::cin;using std::endl;using std::string;int main(){string myNumber = "";cout myNumber;cout