【发布时间】:2011-11-03 10:31:53
【问题描述】:
如何忽略字符串的前 10 个字符?
输入:
str = "hello world!";
输出:
d!
【问题讨论】:
-
string.Substring(9);其中 9 是起始索引
-
记得先检查字符串是否至少有 10 个字符,否则会出现异常。
-
为什么子字符串不支持 (startIndex,endindex) ?每次我们必须计算长度.. :-(
-
@Waqas:其实是str.Substring(10),参数是子串开始被提取的位置
标签: c# asp.net .net string substring