string AboutStr = "About C, C++ and C#";This produces:
string ucAboutStr = AboutStr.ToUpper() ;
Console.WriteLine("AboutStr, ucAboutStr=\n\r{0}\n\r{1}",AboutStr,ucAboutStr) ;
AboutStr, ucAboutStr=
About C, C++ and C#
ABOUT C, C++ AND C#
Need a Trim?
C# provides one trim method to trim white spaces from both the start and end of a string and trimstart and trimend for each end of a string. For most developers, white space means the 0x9 (tab) and 0x20 (i.e. the space ' ' char). However unicode whitespace has a few more characters including 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x0085, 0x2028, and 0x2029. To simplify this, the function isWhiteSpace(char x) is provided. Use it like thischar ch = 'T';The Char class provides a number of static classification functions, most with two overloads like this:
if (char.IsWhiteSpace(ch)) then
{
- IsFunction(Char) - check the Char
- IsFunction(String, Int32) - Check the indexed Char
- IsControl - Is the character a control character?
- IsDigit - Is the character a decimal digit?
- IsLetter - Is the character an alphabetic letter?
- IsLetterOrDigit - Is the character an alphabetic letter or a decimal digit?
- IsNumber - Is the character a number?
- IsPunctuation - Is the character a punctuation mark?
- IsSeparator - Is the character a separator character?
- IsSymbol - Is the character a symbol character?
- IsWhiteSpace - Is the character a white space?
- IsLower - Is the character a lowercase letter?
- IsUpper - Is the character an uppercase letter?
- IsLowSurrogate - Is the Char object a low surrogate?
- IsSurrogate - Is the character a surrogate character.?
- IsSurrogatePair - Are the two Char objects a surrogate pair?
- IsHighSurrogate - Is the Char object a high surrogate?
On the next page - Some More String Functions and Methods

