I had a discusion with a collegue of mine because i use the
microsoft.visualbasic.right method . He said i should not do that ...

Is he right or not ?

Re: advantages and disadvantages of the import of : microsoft.visualb by Jon

Jon
Fri Jun 11 08:11:43 CDT 2004

acidburn@noemail.noemail <acidburn@noemail.noemail> wrote:
> I had a discusion with a collegue of mine because i use the
> microsoft.visualbasic.right method . He said i should not do that ...
>
> Is he right or not ?

I would personally avoid it, particularly if you're using C#. You can
very easily use String.Substring instead, and if you're using C# people
reading your code are much more likely to be familiar with that than
with Right.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

RE: advantages and disadvantages of the import of : microsoft.visualb by jchREMOVE

jchREMOVE
Fri Jun 11 08:56:01 CDT 2004

If you take a look at the IL code for the Right function in the Microsoft.VisualBasic assembly, you will see that it actually calls String.SubString. So if you call Right you will get an extra overhead (although probably quite small) compared to just calling String.SubString.

Regards, Jakob.


"acidburn@noemail.noemail" wrote:

> I had a discusion with a collegue of mine because i use the
> microsoft.visualbasic.right method . He said i should not do that ...
>
> Is he right or not ?
>
>