1. string.Equals() to compare the string content with StringComparison options, for example, care case sensitive or not
2. name1.Trim(), actually it will create another string instance due to string is reference type, so that the output result = False
3. In other word, string is immutable so that even after name1.Trim(), name1’s content is still remain “ C# ”
4. Other string functions are acted the same, for example, .Substring()
Other references:
1. Formatting Numeric Results Tables, Console.Write() & String.Format()
http://msdn.microsoft.com/en-us/library/s8s7t687(v=VS.80).aspx
沒有留言:
張貼留言