Write a java program to count the letters, spaces, numbers and other characters of an input string.

1 1 4
calendar_today agoschedule1 min read
  1. First take the input form the user as a string
  2. copy that string into a character array
  3. write logic for checking each character of character array is a letter/number/space/other-character
  4. print all the updated values of variables

Note :- There is pre-built fuctions to copy all characters of string into a character array which is :
char name_of_character_array[ ] = name_of_string.toCharArray and There are also pre-bilut functions are there to check weather character is letter/number/space in an array which are : Character.isLetter(ch[i]) , Character.isDigit(ch[i]) , Character.isSpaceChar(ch[i]) respectively

🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

Understanding Basic Data Structures for Web Development

MasterCraft - Feb 16

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelski - Mar 19

Your AI Doesn't Just Write Tests. It Runs Them Too.

Kevin Martinez - May 12

The Audit Trail of Things: Using Hashgraph as a Digital Caliper for Provenance

Ken W. Algerverified - Apr 28

The Sovereign Vault — A Comprehensive Guide to Protocol-Driven AI

Ken W. Algerverified - Jun 4
chevron_left
135 Points6 Badges
1Posts
3Comments
I’m a full-stack developer who enjoys building things and figuring out why they break. I mostly work... Show more

Related Jobs

View all jobs →

Commenters (This Week)

3 comments
2 comments
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!