有没有一种简洁的方式(即不是一个for循环)来创建一个指定长度的字符串?无所谓什么是字符串研究。
Is there a succinct way (i.e. not a for loop) to create a string of a specified length? Doesn't matter what is in the string.
您可以使用的字符串
构造函数,一个字符
和 INT
。它创建了一个字符串
实例与字符
重复指定的次数。
You can use the string
constructor that takes a char
and an int
. It creates a string
instance with the char
repeated the specified number of times.