In VB 6 I used to do like the following:
if left(str,3) = "abc" then
In VB.NET when I do the following
sStr.Substring( 0, 3), and the sStr has fewer than 3 characters, it will give
me an error.
For ex: sStr = "a", if I do sStr.Substring( 0, 3), it will give me an error.
So, I was forced to do
if len(sStr) >= 3 then
if sStr.Substring( 0, 3)
:
Is there an easier way to to it besides the above code ?
Thanks
if left(str,3) = "abc" then
In VB.NET when I do the following
sStr.Substring( 0, 3), and the sStr has fewer than 3 characters, it will give
me an error.
For ex: sStr = "a", if I do sStr.Substring( 0, 3), it will give me an error.
So, I was forced to do
if len(sStr) >= 3 then
if sStr.Substring( 0, 3)
:
Is there an easier way to to it besides the above code ?
Thanks
Comment