Monday, June 30, 2014

Find string length without Len function

Option Explicit
Dim str, i, x
str = "Baba"
i = 1
Do
    x = mid(str, i, 1)
    If x = Empty then
        Exit Do
    End If
    i = i+1
Loop

Print "Length of the string '"& str & "' is " & i-1

No comments:

There was an error in this gadget