Microsoft.VisualBasic.Chr(0)

  • Thread starter Thread starter Qwert
  • Start date Start date
Q

Qwert

Hello you,

How does one replace the following function from 'Microsoft.VisualBasic'
namespace:

REM Return the character associated with the specified character code.
Microsoft.VisualBasic.Chr(0)

with a function from 'System' namespace?

Thanks,

me.


i.e.
Microsoft.VisualBasic.InStr(strMyString, "e")

would become

strMyString.IndexOf("e") Rem System.String.IndexOf().
 
Qwert said:
How does one replace the following function from 'Microsoft.VisualBasic'
namespace:

REM Return the character associated with the specified character code.
Microsoft.VisualBasic.Chr(0)

with a function from 'System' namespace?

There is no replacement. I prefer VB.NET's 'ControlChars.NullChar', others
'vbNullChar', but that's up to personal preference.
i.e.
Microsoft.VisualBasic.InStr(strMyString, "e")

would become

strMyString.IndexOf("e") Rem System.String.IndexOf().

I am just curious why someone would want to do that. If you are using
VB.NET, /use/ it.
 
Qwert,
How does one replace the following function from 'Microsoft.VisualBasic'
namespace:

REM Return the character associated with the specified character code.
Microsoft.VisualBasic.Chr(0)

with a function from 'System' namespace?

i.e.
Microsoft.VisualBasic.InStr(strMyString, "e")

would become

strMyString.IndexOf("e") Rem System.String.IndexOf().
In what program language do you need this?

Cor
 
I am just curious why someone would want to do that. If you are using
VB.NET, /use/ it.

As a result of some articles I read on the internet, I was under the
impresion that the namespace Microsoft.VisualBasic was not part of the core
..NET framework, allthough it is distributed with every .NET framework.
And it will probably remain so, however I try to find similar functionality
in other namespaces. Not important, but tricky for me sometimes since there
are so many namespaces.
 
Qwert said:
As a result of some articles I read on the internet, I was under the
impresion that the namespace Microsoft.VisualBasic was not part of the
core .NET framework, allthough it is distributed with every .NET
framework.
And it will probably remain so, however I try to find similar
functionality in other namespaces. Not important, but tricky for me
sometimes since there are so many namespaces.

It's always good to know about the different ways to archieve a certain
thing. However, I suggest to make use of VB.NET's features when possible.
'Microsoft.VisualBasic' can be seen as part of VB.NET and thus it's obvious
that this namespace should be used.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top