Is it any way possible to find out the length of a string without using LEN function.
Can someone enlighten me on this, as i am new in VB coding.
Length of a string withut using len function.
Page 1 of 13 Replies - 562 Views - Last Post: 09 August 2012 - 07:46 AM
Replies To: Length of a string withut using len function.
#2
Re: Length of a string withut using len function.
Posted 08 August 2012 - 11:14 PM
Is it any way possible to tell me what color the sky is without using the name of a color?
Doesn't make much sense right. Any particular reason why you want to avoid the function that gives you the exact answer to the question?
I suppose you could create a loop through Mid(). Start the length you supply to the function with 1 and keep increasing it until the value returned by Mid() is equal to the string.
Once this code finishes, "i" should be the length of "SomeString". Of course I think Len() is just a safer bet.
Doesn't make much sense right. Any particular reason why you want to avoid the function that gives you the exact answer to the question?
I suppose you could create a loop through Mid(). Start the length you supply to the function with 1 and keep increasing it until the value returned by Mid() is equal to the string.
Dim i as Integer
i = 1
Do While Mid("someString",0,i) <> SomeString
i = i + 1
Loop
Once this code finishes, "i" should be the length of "SomeString". Of course I think Len() is just a safer bet.
#3
Re: Length of a string withut using len function.
Posted 09 August 2012 - 06:55 AM
Len() was invented so you wont have to write your own text length calculating function.
why bother to find different way?
why bother to find different way?
#4
Re: Length of a string withut using len function.
Posted 09 August 2012 - 07:46 AM
Come on OP, give us the reason why you can't / don't want to use the LEN function.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|