M
MS Newsgroups
Hi,
I have a feeling there is a easy answer to this. I need to return the first
9 characters in a string if it is longer than 9 characters, otherwise the
whole string.
If was hoping this code would do this:
Dim myString as string="string"
msgbox (mystring.substring(0,9))
But this gives me a "Index and length must refer to a location within the
string." error.
I understand that i could do this with if statements, but i was wondering if
there is a easier ".Net" way to do this
Any ideas ?
Regards
Niclas
I have a feeling there is a easy answer to this. I need to return the first
9 characters in a string if it is longer than 9 characters, otherwise the
whole string.
If was hoping this code would do this:
Dim myString as string="string"
msgbox (mystring.substring(0,9))
But this gives me a "Index and length must refer to a location within the
string." error.
I understand that i could do this with if statements, but i was wondering if
there is a easier ".Net" way to do this
Any ideas ?
Regards
Niclas