simple string parsing problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mohit04
Forum Newbie
Posts: 1
Joined: Thu May 25, 2006 1:53 pm

simple string parsing problem

Post by mohit04 »

Hi ,
I need to count the number of uppercase letters in a a string.How can this be done?
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

My suggestion:
Use regex to get rid of any thing that is not an upper case letter ([^A-Z]) and then use strlen() to get the length of the new string.
Post Reply