private static string SetValue(string input, string reference)
{
string[] sentence = input.Split(' ');
for(int word = 0; word<sentence.Length; word++)
{
if (sentence[word].Equals(reference, StringComparison.OrdinalIgnoreCase))
{
return String.Join(" ", sentence.subarray(word+1,sentence.Length))
}
}
}
如何轻松完成sentence.subarray(word+1,sentence.Length)
或以其他方式执行此操作?加入字符串数组的其余部分
看看http://msdn.microsoft.com/en-us/library/bb358985.aspx – 2013-02-18 10:56:09