Write a script to find out the number of “T” in the given string?
x="UFT test automation"
y=split(x,"")
count=0
total=0
For i=lbound(y) to ubound(y) step 1
z=len(y(i))
count=0
For j=1 to z step 1
a=mid(y(i),j,1)
if (a="T" or a="t") then
count=count+1
end if
Next
total=total+count
msgbox "Given string has "&count&" letters"
Next
msgbox "Total letters= "&total
No comments:
Post a Comment
Note: only a member of this blog may post a comment.