Length of a string without using InBuilt Functions using Vb Script
Dim arr()
On error resume next
str="My name is venkat kandula"
Set regex=new RegExp
regex.IgnoreCase=true
regex.Global=true
regex.pattern ="."
Set obj=regex.execute(str)
ReDim arr(obj.count-1)
i=0
For each temp in obj
arr(i)=temp.value
i=i+1
Next
msgbox i
Set obj=nothing
Set regex=nothing
Dim arr()
On error resume next
str="My name is venkat kandula"
Set regex=new RegExp
regex.IgnoreCase=true
regex.Global=true
regex.pattern ="."
Set obj=regex.execute(str)
ReDim arr(obj.count-1)
i=0
For each temp in obj
arr(i)=temp.value
i=i+1
Next
msgbox i
Set obj=nothing
Set regex=nothing
No comments:
Post a Comment