Here it is....! How can we write a program in vbscript to find length of string without using len() function.
str="lengthofthestring"
i=1
do
str1=mid(str,i,1)
if str1<>"" then
i=i+1
else
exit do
end if
loop until str1=""
msgbox i-1
just copy paste the above code to QTP or UFT you will get the out put
str="lengthofthestring"
i=1
do
str1=mid(str,i,1)
if str1<>"" then
i=i+1
else
exit do
end if
loop until str1=""
msgbox i-1
just copy paste the above code to QTP or UFT you will get the out put
No comments:
Post a Comment