String: "hello to the very tall person I am about to meet"
我希望它变成这样:
String: hello to the very tall person I am about to meet
我只能找到修剪开始的代码吗?
最佳答案
使用 String.Substring 方法。
因此,如果您的字符串存储在变量 mystr
中,请执行以下操作:
mystr = mystr.Substring(1, mystr.Length - 2);
关于c# - C# 如何删除字符串的第一个和最后一个字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42964150/