由网友(屋顶上的小猫咪)分享简介:可以说我有字符串:MyNamespace.SubNameSpace.MyClassName"MyNamespace.SubNameSpace.MyClassName"我如何提取最后一期后刚刚的一切,MyClassNameHow do I extract just everything after the las...
可以说我有字符串:
MyNamespace.SubNameSpace.MyClassName
"MyNamespace.SubNameSpace.MyClassName"
我如何提取最后一期后刚刚的一切,MyClassName
How do I extract just everything after the last period, "MyClassName"
推荐答案
使用 String.Substring 和 String.LastIndexOf 方法
Use String.Substring and String.LastIndexOf methods.
string str = "MyNamespace.SubNameSpace.MyClassName";
string str1 = str.Substring(str.LastIndexOf('.') + 1);
相关推荐
最新文章