gpt4 book ai didi

c# - 返回一个重复多次的字符串

转载 作者:行者123 更新时间:2023-11-30 19:52:48 29 4
gpt4 key购买 nike

<分区>

我想根据项目深度在字符串前插入一些 *,我想知道是否有办法返回重复 Y 次的字符串。示例:

string indent = "***";
Console.WriteLine(indent.Redraw(0)); //would print nothing.
Console.WriteLine(indent.Redraw(1)); //would print "***".
Console.WriteLine(indent.Redraw(2)); //would print "******".
Console.WriteLine(indent.Redraw(3)); //would print "*********".

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com