Right and Left

  • Thread starter Thread starter John
  • Start date Start date
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.VisualBasic.Left("abcdef",1) instead
3) Create a function VBLeft() which calls Microsoft.VisualBasic.Left

Right() is the one you'll miss.
 
SurturZ said:
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.VisualBasic.Left("abcdef",1) instead
3) Create a function VBLeft() which calls Microsoft.VisualBasic.Left

TheString.SubString(0, ...) 'however, not 100% equal
Right() is the one you'll miss.


Or use Microsoft.VisualBasic[.Strings].Right



Armin
 
I believe you could do this at the top of your class:

Imports MVB = Microsoft.VisualBasic

then in your code:

a = MVB.Left("abcdef",1) 'for example
 
SurturZ said:
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.VisualBasic.Left("abcdef",1) instead
3) Create a function VBLeft() which calls Microsoft.VisualBasic.Left

I simply qualify the function call with the module containing it:
'Strings.Left'.
 
Herfried K. Wagner said:
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....yada.Left() for years in WinForms modules and never really
realized the Strings.Left() option. Much more elegant! Thanks!
 
Back
Top