Re: Substring question
- From: "Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx>
- Date: Tue, 2 May 2006 17:40:48 +0200
Fniles,
Why do you not use that same instructions as in VB6 as they are there if you
are used to those. They are legal (as well in the future) in VBNet.
The most of the VB functions have something extra, like to overcome the
problem as you wrote.
Cor
"fniles" <fniles@xxxxxxxxxx> schreef in bericht
news:ezjKGxfbGHA.3840@xxxxxxxxxxxxxxxxxxxxxxx
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
.
- References:
- Substring question
- From: fniles
- Substring question
- Prev by Date: VB2005 Short address pointer
- Next by Date: Re: making datareaders
- Previous by thread: Re: Substring question
- Next by thread: Re: Substring question
- Index(es):
Relevant Pages
|