只是出于好奇,一个简短的问题。
string str = "string";
Console.WriteLine(str.EndsWith(string.Empty)); //true
Console.WriteLine(str.LastIndexOf(string.Empty) == str.Length); //false
//of course string are indexed from 0,
//just wrote if for fun to check whether empty string get some extra index
///somehow by a miracle:)
//finally
Console.WriteLine(str.LastIndexOf(string.Empty)
== str.LastIndexOf('g')); //true :)
string.Empty
的概念是什么?它到底是什么? - thecoop