Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find capital letter in a string
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,

How can i find the ,how many capital letters in a given string

str= "ADlanda"

count is 2

regards,
Arul.D
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Arul,

Use below mentioned code.

Code:
str= "ADlanda"
n=len(str)
msgbox n
i=0
strRes=""
While i<n
a=mid(str,i+1,1)
If  ASC(a)>=65 AND ASC(a)<=90 Then
        strRes=strRes &a
End If
i=i+1
Wend
msgbox "Your Result is: " &strRes


Might be we will be having easy code also. But I know this code only.
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi kotaramamohana,

Thanks for ur script.

Code:
str= "ADlanda"
n=len(str)
msgbox n
For i=0 to n-1
a=mid(str,i+1,1)
If ASC(a)>=65 AND ASC(a)<=90 Then
strRes=strRes &a
End If
Next
msgbox "Your Result is: " &strRes

Regards,
Arul
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  String Pattern : Alternet Character Capital abhideshpande001 4 3,543 09-03-2015, 03:43 PM
Last Post: abhideshpande001
  How to have a variable that has a string comma string .. shareq1310 5 5,062 11-09-2011, 03:33 PM
Last Post: parminderdhiman84
  Find number in a string pjeigenn 9 26,831 12-03-2010, 04:26 PM
Last Post: bfakruddin
  string function to get a letter from a string ajay.r1982 3 7,564 06-30-2009, 08:58 PM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 1 Guest(s)