假设我有字符串:
"我的命名空间.SubNameSpace.我的类名"
我如何提取最后一段“MyClassName”之后的所有内容
最佳答案
使用 String.Substring 和 String.LastIndexOf 方法。
string str = "MyNamespace.SubNameSpace.MyClassName";
string str1 = str.Substring(str.LastIndexOf('.') + 1);
关于c# - 我如何在字符串c#中获取某个索引之后的所有内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2543273/