String defined by the ASCII codes of its characters

### 4.2.8 String defined by the ASCII codes of its characters

The char command translates ASCII codes to strings.

- char takes c, an integer representing an ASCII code or a list of ASCII codes.
- char(c) returns the string whose character has ASCII code c or whose characters have ASCII codes the elements of the list c.

#### Example

char([97,98,99,100])

“abcd” |  |  |  |  |  |  |  |  |  |

char(97)

“a” |  |  |  |  |  |  |  |  |  |

Note that there are 256 ASCII codes, 0 through 255. If asc is given an integer c not in that range, it will use the integer in that range which equals c modulo 256.

char(353)

“a” |  |  |  |  |  |  |  |  |  |

because 353−256=97.