How to multiply an "X" character as many times as you want?

Asked

Viewed 1,242 times

7

Is there a method that multiplies an "X" character as many times as I want? example:

I have the character "P"

P x 5 = "PPPPP"

Is there any ready method in . Net?

2 answers

11


6

In VB.NET

It’s the same as the @Maniero response, but in VB.NET, since no language has been specified.

Dim texto = New String("P", 5)

See on dotNetFiddle

Browser other questions tagged

You are not signed in. Login or sign up in order to post.