StrDup

G

Guest

Hello there-

Someone knows a page or document with a cross reference between VB.NET and
C#?

--For example. I cannot find easily an equivalence of the funcion StrDup of
VB.NET in C#
 
N

Nicholas Paldino [.NET/C# MVP]

Harvey,

You can do this easily with the string constructor. There is an
overload that takes a character and the number of times to duplicate it and
creates a new string.

If you have a need for the exact logic (where you can pass non-strings,
or strings with more than one character, and it takes the first character),
then you can always set a refrence to Microsoft.VisualBasic.dll, and then
use the static StrDup function on the Strings class in the
Microsoft.VisualBasic namespace.

Hope this helps.
 
H

Harvey Triana

Thank you


Nicholas Paldino said:
Harvey,

You can do this easily with the string constructor. There is an
overload that takes a character and the number of times to duplicate it
and creates a new string.

If you have a need for the exact logic (where you can pass non-strings,
or strings with more than one character, and it takes the first
character), then you can always set a refrence to
Microsoft.VisualBasic.dll, and then use the static StrDup function on the
Strings class in the Microsoft.VisualBasic namespace.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hello there-

Someone knows a page or document with a cross reference between VB.NET
and C#?

--For example. I cannot find easily an equivalence of the funcion StrDup
of VB.NET in C#
 

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

Top