这节课我们主要学习了String and Regular Expressions
Introduction of Strings Computer was used for numeric munipulation:
1. Most programs are concerned more with strings of characters than with strings of numbers.
2. C# provide built-in support for a fully string type.
3. C# string type and .NET System.String class.
4. Build new string by System.Text.StringBuilder Class.
5. System.Text.RegularExpressions.Regex Class.
首先,string有不可变性▼
然后我们讲了利用ToString将其他格式的字符串变成String格式的字符串,不过这个上次实验已经用过了所以应该算是复习吧。
然后我们讲了Compare的用法:
1. A negative integer, if the first string is less than the second string.
2. 0, if the strings are equal.
3. A positive integer, if the first string is greater than the second string.
以下就是我用ABC来尝试的compare用法,可见他是一直比较直到遇到不同的一位然后判断大小▼
然后我们讲了Using Regular Expressions:
1. Regex System.Text.RegularExpressions namespace is the home of objects associated with regular expressions.
2. The central class for regular expression support is Regex, which represents an immutable, compiled regular expression.
以下就是Instance Regex的比较▼
以下是Static Regex▼
以上就是我这节课学习到的内容。
原文:http://www.cnblogs.com/luvianlan/p/4438503.html