2013年5月28日 星期二

C# Fundation, Part 3 (String Type)

image

 

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()

image

 

Other references:

1. Formatting Numeric Results Tables, Console.Write() & String.Format()

image

http://msdn.microsoft.com/en-us/library/s8s7t687(v=VS.80).aspx

image

沒有留言:

張貼留言