15.01.2013 Views

Free-ebooks-library - Bahar Ali Khan

Free-ebooks-library - Bahar Ali Khan

Free-ebooks-library - Bahar Ali Khan

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ecause in Turkey, char.ToUpper ('i') is 'İ' (notice the dot on top!). To avoid this<br />

problem, System.Char (and System.String) also provides culture-invariant versions<br />

of ToUpper and ToLower ending with the word Invariant. These always apply English<br />

culture rules:<br />

Console.WriteLine (char.ToUpperInvariant ('i')); // I<br />

This is a shortcut for:<br />

Console.WriteLine (char.ToUpper ('i', CultureInfo.InvariantCulture))<br />

For more on locales and culture, see “Formatting and parsing” on page 212.<br />

Most of char’s remaining static methods are related to categorizing characters and<br />

are listed in Table 6-1.<br />

Table 6-1. Static methods for categorizing characters<br />

Static method Characters included Unicode categories included<br />

IsLetter A–Z, a–z, and letters of other alphabets UpperCaseLetter<br />

LowerCaseLetter<br />

TitleCaseLetter<br />

ModifierLetter<br />

OtherLetter<br />

IsUpper Uppercase letters UpperCaseLetter<br />

IsLower Lowercase letters LowerCaseLetter<br />

IsDigit 0–9 plus digits of other alphabets DecimalDigitNumber<br />

IsLetterOrDigit Letters plus digits Sum of IsLetter and IsDigit<br />

IsNumber All digits plus Unicode fractions and Roman numeral<br />

symbols<br />

DecimalDigitNumber<br />

LetterNumber<br />

OtherNumber<br />

IsSeparator Space plus all Unicode separator characters LineSeparator<br />

ParagraphSeparator<br />

IsWhiteSpace All separators plus \n, \r, \t, \f, and \v LineSeparator<br />

IsPunctuation Symbols used for punctuation in Western and other<br />

alphabets<br />

ParagraphSeparator<br />

DashPunctuation<br />

IsSymbol Most other printable symbols MathSymbol<br />

194 | Chapter 6: Framework Fundamentals<br />

ConnectorPunctuation<br />

InitialQuotePunctuation<br />

FinalQuotePunctuation<br />

ModifierSymbol<br />

OtherSymbol

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!