111,128
社区成员
发帖
与我相关
我的任务
分享 var s = "19.2% 66.5% 2013-08-03 20:21:45 6.40 4.80 1.32 13.9% 18.6% 67.5";
var n = 3;
var index = s.Length;
while(n-- > 0) index = s.LastIndexOf(" ", index - 1);
Console.WriteLine(s.Substring(index + 1));
13.9% 18.6% 67.5
string str="19.2% 66.5% 2013-08-03 20:21:45 6.40 4.80 1.32 13.9% 18.6% 67.5";
string s="";
// 最后一个空格位置
int index1=str.LastIndexOf(" ");
s=str.Substring(index1);
// 倒数第二个空格位置
int index2=s.LastIndexOf(" ");
s=.str.Substring(index2);
// 倒数第三个空格位置
int index3=s.LastIndexOf(" ");
// 第一个空格位置
int index1=str.IndexOf(" ");
// 第二个空格位置
int index2=str.IndexOf(" ", index1+1);
// 第三个空格位置
int index3=str.IndexOf(" ", index2+1);