Skip to content

Strings and Chars

Bill Hails edited this page Jun 5, 2018 · 8 revisions

Strings are lists of chars.

Given we have lists, it made sense to avail ourselves of them to implement strings. So for example:

"Hello," @@ " world!"

and

length("hello")

both work, and we get those, and all the other list operations on strings for free.

See Lists for @@ etc.

We use the C convention of single quotes ('a') to delimit chars and double quotes ("hello!") to delimit strings, so

'H' @ "ello"

is how to build strings from chars, and

['H', 'i']

prints as "Hi".

Up: Home

Next: Conditionals

Clone this wiki locally