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#