D Programming Language 2.0

- Comments
- D
- Search
- Home

Last update Sun Jul 10 10:47:14 2011

# std.ascii

Functions which operate on ASCII characters.

All of the functions in std.ascii accept unicode characters but effectively ignore them. All isX functions return false for unicode characters, and all toX functions do nothing to unicode characters.

For functions which operate on unicode characters, see std.uni.

References:
ASCII Table, Wikipedia

License:
Boost License 1.0.

Authors:
Walter Bright and Jonathan M Davis

Source:
std/ascii.d

immutable string hexDigits;
  0..9A..F

immutable string fullHexDigits;
  0..9A..Fa..f

immutable string digits;
  0..9

immutable string octalDigits;
  0..7

immutable string lowercase;
  a..z

immutable string letters;
  A..Za..z

immutable string uppercase;
  A..Z

immutable string whitespace;
  ASCII whitespace

immutable string newline;
  Newline sequence for this system.

pure nothrow @safe bool isAlphaNum(dchar c);
  Returns whether c is a letter or a number (0..9, a..z, A..Z).

pure nothrow @safe bool isAlpha(dchar c);
  Returns whether c is an ASCII letter (A..Z, a..z).

pure nothrow @safe bool isLower(dchar c);
  Returns whether c is a lowercase ASCII letter (a..z).

pure nothrow @safe bool isUpper(dchar c);
  Returns whether c is an uppercase ASCII letter (A..Z).

pure nothrow @safe bool isDigit(dchar c);
  Returns whether c is a digit (0..9).

pure nothrow @safe bool isOctalDigit(dchar c);
  Returns whether c is a digit in base 8 (0..7).

pure nothrow @safe bool isHexDigit(dchar c);
  Returns whether c is a digit in base 16 (0..9, A..F, a..f).

pure nothrow @safe bool isWhite(dchar c);
  Whether or not c is a whitespace character. That includes the space, tab, vertical tab, form feed, carriage return, and linefeed characters.

pure nothrow @safe bool isControl(dchar c);
  Returns whether c is a control character.

pure nothrow @safe bool isPunctuation(dchar c);
  Whether or not c is a punctuation character. That includes all ASCII characters which are not control characters, letters, digits, or whitespace.

pure nothrow @safe bool isGraphical(dchar c);
  Whether or not c is a printable character other than the space character.

pure nothrow @safe bool isPrintable(dchar c);
  Whether or not c is a printable character - including the space character.

pure nothrow @safe bool isASCII(dchar c);
  Whether or not c is in the ASCII character set - i.e. in the range 0..0x7F.

pure nothrow @safe dchar toLower(dchar c);
  If c is an uppercase ASCII character, then its corresponding lowercase letter is returned. Otherwise, c is returned.

pure nothrow @safe dchar toUpper(dchar c);
  If c is a lowercase ASCII character, then its corresponding uppercase letter is returned. Otherwise, c is returned.

Copyright 2000 - | Page generated by Ddoc.