You can but in a Windows Form they get shadowed by the .Left and .Right
properties of the form. It's quite annoying.
You have a few options:
1) (my preferred) Use Mid() instead
2) Type Microsoft.Visua lBasic.Left("ab cdef",1) instead
3) Create a function VBLeft() which calls Microsoft.Visua lBasic.Left
Right() is the one you'll miss.
--
David Streeter
Synchrotech Software
Sydney Australia
"John" wrote:
Hi
>
Why can't I use Right and Left string functions in vb anymore?
>
Thanks
>
Regards
>
>
>
You can but in a Windows Form they get shadowed by the .Left and
.Right properties of the form. It's quite annoying.
>
You have a few options:
1) (my preferred) Use Mid() instead
2) Type Microsoft.Visua lBasic.Left("ab cdef",1) instead
3) Create a function VBLeft() which calls Microsoft.Visua lBasic.Left
TheString.SubSt ring(0, ...) 'however, not 100% equal
I believe you could do this at the top of your class:
Imports MVB = Microsoft.Visua lBasic
then in your code:
a = MVB.Left("abcde f",1) 'for example
"SurturZ" wrote:
You can but in a Windows Form they get shadowed by the .Left and .Right
properties of the form. It's quite annoying.
>
You have a few options:
1) (my preferred) Use Mid() instead
2) Type Microsoft.Visua lBasic.Left("ab cdef",1) instead
3) Create a function VBLeft() which calls Microsoft.Visua lBasic.Left
>
Right() is the one you'll miss.
>
--
David Streeter
Synchrotech Software
Sydney Australia
>
>
"John" wrote:
>
Hi
Why can't I use Right and Left string functions in vb anymore?
You can but in a Windows Form they get shadowed by the .Left and .Right
properties of the form. It's quite annoying.
>
You have a few options:
1) (my preferred) Use Mid() instead
2) Type Microsoft.Visua lBasic.Left("ab cdef",1) instead
3) Create a function VBLeft() which calls Microsoft.Visua lBasic.Left
I simply qualify the function call with the module containing it:
'Strings.Left'.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.atwrot e in message
news:ulgs%23J$U IHA.3556@TK2MSF TNGP02.phx.gbl. ..
"SurturZ" <surturz@newsgr oup.nospamschri eb:
>You can but in a Windows Form they get shadowed by the .Left and .Right
>properties of the form. It's quite annoying.
>>
>You have a few options:
>1) (my preferred) Use Mid() instead
>2) Type Microsoft.Visua lBasic.Left("ab cdef",1) instead
>3) Create a function VBLeft() which calls Microsoft.Visua lBasic.Left
>
I simply qualify the function call with the module containing it:
'Strings.Left'.
>
Wow... glad I stumbled over this post. Thank you Herfried. I've been doing
Microsoft....ya da.Left() for years in WinForms modules and never really
realized the Strings.Left() option. Much more elegant! Thanks!
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Comment