static class · System

Char

public static class Char
Kind
static class
Namespace
System
Assembly
System.Core
Access
public, static, abstract
Source file
Char.ant

Inheritance

Base classes
Any Char

Methods

IsDigit(u32 c) : bool
#

static

IsAsciiLetter(u32 c) : bool
#

static

IsUpper(u32 c) : bool
#

static

IsLower(u32 c) : bool
#

static

IsLetter(u32 c) : bool
#

static

IsLetterOrDigit(u32 c) : bool
#

static

IsWhiteSpace(u32 c) : bool
#

static

IsPunctuation(u32 c) : bool
#

static

IsSurrogate(u32 c) : bool
#

static

IsHighSurrogate(u32 c) : bool
#

static

IsLowSurrogate(u32 c) : bool
#

static

ToUpper(u32 c) : u32
#

static

ToLower(u32 c) : u32
#

static

DigitValue(u32 c) : i32
#

static

The digit's value (0 to 9), or -1.

ToString(u32 c) : str
#

static

The character as a str (in UTF-8).

Inherited members (5)

Source

Char as Antril, decompiled from its Larva HIR.

System.Char.ant
// System.Char — System.Core (decompiled from Larva HIR)

into namespace System
{
	public static class Char
	{
		public:
			IsDigit(u32 c) : bool => c >= 48 && c <= 57;

			IsAsciiLetter(u32 c) : bool => c >= 97 && c <= 122 || c >= 65 && c <= 90;

			IsUpper(u32 c) : bool => c >= 65 && c <= 90 || c >= 192 && c <= 222 && c != 215;

			IsLower(u32 c) : bool => c >= 97 && c <= 122 || c >= 223 && c <= 255 && c != 247;

			IsLetter(u32 c) : bool
			{
				if (c < 128)
					return IsAsciiLetter(c);
				if (c < 256)
					return c >= 192 && c != 215 && c != 247;
				return c < 8192 || c >= 12352 && c < 55296 || c >= 63744 && c < 65072 || c >= 65536 && c < 126976 || c >= 131072 && c < 196608;
			}

			IsLetterOrDigit(u32 c) : bool => IsLetter(c) || IsDigit(c);

			IsWhiteSpace(u32 c) : bool
			{
				return c == 32 || c >= 9 && c <= 13 || c == 160 || c == 8232 || c == 8233 || c == 12288 || c >= 8192 && c <= 8202;
			}

			IsPunctuation(u32 c) : bool => c >= 33 && c <= 47 || c >= 58 && c <= 64 || c >= 91 && c <= 96 || c >= 123 && c <= 126;

			IsSurrogate(u32 c) : bool => c >= 55296 && c <= 57343;

			IsHighSurrogate(u32 c) : bool => c >= 55296 && c <= 56319;

			IsLowSurrogate(u32 c) : bool => c >= 56320 && c <= 57343;

			ToUpper(u32 c) : u32 => c >= 97 && c <= 122 || c >= 224 && c <= 254 && c != 247 ? c - 32 : c;

			ToLower(u32 c) : u32 => c >= 65 && c <= 90 || c >= 192 && c <= 222 && c != 215 ? c + 32 : c;

			/// The digit's value (0 to 9), or -1.
			DigitValue(u32 c) : i32 => IsDigit(c) ? (i32)(c - 48) : -1;

			/// The character as a str (in UTF-8).
			ToString(u32 c) : str => Unicode.ToString(c);
	}
}
Esc