Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何用特定字符(例如 make string 和长度(y,4))填充字符串,结果是 yyyy 我知道在 c++ 中有类似的东西,fillstring 在 c# 中也存在吗
只需使用适当的构造函数:
string text = new string('y', 4);