XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

char


Type:   -   function (subr)
Source:   -   xlstr.c

Syntax

(char string position)
string - a string expression
position - an integer expression
returns - the ASCII code of the character

Description

The 'char' function returns the ASCII numeric value of the character at the specified 'position' in the 'string'. A position of '0' is the first character in the string.

Examples

(char "12345" 0)          ; returns #\1
(char "12 45" 2)          ; returns #\Space
(string (char "1234" 3))  ; returns "4"
(char "1234" 9)           ; error: index out of range

See the char function in the XLISP 2.0 manual.

  Back to Top


XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next