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?
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?
11
Yes, there is, just build the string indicating the number of times you want:
var texto = new String('P', 5);
Behold working in the ideone. And in the .NET Fiddle. Also put on the Github for future reference.
6
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 .net string char
You are not signed in. Login or sign up in order to post.