假设我有一个字符串,例如,
string snip = "</li></ul>";
Run Code Online (Sandbox Code Playgroud)
我想基本上写多次,取决于一些整数值.
string snip = "</li></ul>";
int multiplier = 2;
// TODO: magic code to do this
// snip * multiplier = "</li></ul></li></ul>";
Run Code Online (Sandbox Code Playgroud)
编辑:我知道我可以轻松编写自己的函数来实现这一点,我只是想知道是否有一些我不知道的奇怪的字符串运算符