Chr Function

Returns the character whose ASCII value is passed.

Syntax
result = Chr( value )

Parameters
value | Integer, | The numeric value ("code point") of the character you want, in the range 0-127.

Return Value
Result | String | The character whose ASCII value was passed.

# Notes

The Chr function returns the character whose value is specified.

The Chr function will return a single byte String when running on single byte systems and return a double byte string when running on double byte systems. If you need to get a single byte string regardless of whether the system software is single or double byte, use the ChrB function.

# Examples

These examples use the Chr function to return the characters whose ASCII values are specified.

Dim Tab,CR as String
Tab=Chr(9) //returns a tab
CR=Chr(13) //returns carriage return
CR= Encodings.ASCII.Chr(13) //also returns carriage return

# See Also

Asc, Encoding, InStr, Left, Len, Mid, Right functions; EndOfLine, TextEncoding classes; Encodings object.