Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

dchar

Part of KeywordsCategory

Purpose

To show usage of the dchar character type.

Description

The dchar type is like the char type, but bigger (corresponds to a UTF-32 Unicode code unit).

Example

import std.stdio;

void main () { 
  dchar c = '0'd;

  /* Character literals must be quoted (no "naked" escape sequences allowed) 
   * If it was a string literal, quotes are optional.
   */
    
  writefln("%s", cast(bit) (c == '\U000000AA'd || c == '\U000000BA'd));
}