Hmmm.  You might want to look at the String constructor methods.

In VB.Net
    Dim myVar As New String("-"c, 65)
    Dim otherVar As New String(CType("-", Char), 65)
    Dim yetAnotherVar As New String(Convert.ToChar("-"), 65)
In C#

String myVar = new string(Convert.ToChar("-"),65);

Walt Ritscher


-----Original Message-----
From: dotnet discussion [mailto:[EMAIL PROTECTED]] On Behalf Of
Patrick Burrows
Sent: Thursday, May 30, 2002 7:42 AM
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] C# Equivs of VB Functions


Nevermind. Looks like PadRight or PadLeft will do what I want.

(you always find the answer as soon as you hit send... it is an
unwritten rule of listservers).


Patrick Burrows
Found an old dog And he seems to like me
--------------------
Now Playing: phish - billy breathes - 03 - waste (unnamed server)
--------------------



> -----Original Message-----
> From: Patrick Burrows
> Sent: Thursday, May 30, 2002 10:40 AM
> To: [EMAIL PROTECTED]
> Subject: C# Equivs of VB Functions
>
>
> Is there an equivalent in C# of the VB String() function? I want to
> create a line of 65 "-" characters (am formatting some text).
>
> In VB, I just do:
>         MyVar = String(65,"-")
>
> Am looking through the members of the String class and don't see
> anything.
>
> I mean, obviously, I can accomplish the same thing in
> probably a couple
> dozen different ways. Just am trying to learn the object model as much
> as I am trying to get the project finished.
>
> Patrick Burrows
> With a horrid little pistol and a lariat
> --------------------
> Now Playing: 01 dolly dagger (unnamed server)
> --------------------
>
> You can read messages from the DOTNET archive, unsubscribe
> from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
>

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to