Characters

Operators and functions for working with characters (char type) are described here.

Operators

Operator

Result

Description

char + char

str

Returns a string of two characters.

char + str

str

Returns a string as the result of adding a string to a character.

str + char

str

Returns a string as the result of adding a character to the string.

char = char

char

Assignment operator.

str += char

str

Appends a character to the string

char == char

bool

Returns true if the two characters are equal and false, otherwise.

char > char

bool

Returns true if the first character is greater than the second and false, otherwise.

char < char

bool

Returns true if the first character is less than the second and false, otherwise.

char != char

bool

Returns true if the two characters are not equal and false, otherwise.

char >= char

bool

Returns true if the first character is greater than or equal to the second and false, otherwise.

char <= char

bool

Returns true if the first character is less than or equal to the second and false, otherwise.

Functions

int( char c ) int

The int function returns the numeric value of a character.

str(char c) str

The str function converts a character to a string and returns this string.