Method-1
----------------------------------
str1="ABCDEFG"
var=InStrRev(str1,Right(str1,1))
MsgBox var
Method-2
----------------------------------
strVal = InputBox("please enter any value")
msgbox len(strVal)
for i=1 to 1000
val = mid(strVal ,1,i)
msg=msg & val & vbnewline
arrVar = split(msg,vbnewline)
blnres = arrVar(i-1)
If blnres = strVal then
msgbox "The length of the given string is := "& i
exit for
End if
Next
Method-3
----------------------------------
str="ABCDEFG"
i=0
Do Until str=""
i= i+1
b=Left(str,1)
str=Replace(str,b,"")
Loop
MsgBox i
----------------------------------
str1="ABCDEFG"
var=InStrRev(str1,Right(str1,1))
MsgBox var
Method-2
----------------------------------
strVal = InputBox("please enter any value")
msgbox len(strVal)
for i=1 to 1000
val = mid(strVal ,1,i)
msg=msg & val & vbnewline
arrVar = split(msg,vbnewline)
blnres = arrVar(i-1)
If blnres = strVal then
msgbox "The length of the given string is := "& i
exit for
End if
Next
Method-3
----------------------------------
str="ABCDEFG"
i=0
Do Until str=""
i= i+1
b=Left(str,1)
str=Replace(str,b,"")
Loop
MsgBox i