gpt4 book ai didi

c# - .NET 的字符串操作问题

转载 作者:太空宇宙 更新时间:2023-11-03 18:17:43 24 4
gpt4 key购买 nike

如果它什么都不做,我如何才能从下面删除第一个逗号 + 空格。

string comments = ", 38, ";

最佳答案

if( comments.StartsWith(", ") && comments.Length > 2 ) {
comments = comments.Substring(2);
}

关于c# - .NET 的字符串操作问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3705707/

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