On this page:
=$
&
list$
str$
chr$
empty$?
len$
list&
head$
tail$
left$
right$
mid$
slice$
instr
split
format$

3.7 Strings🔗ℹ

procedure

(=$ x y)  boolean?

  x : string?
  y : string?
Returns True if the two strings are equal.

procedure

(& str ...)  string?

  str : string?
Concatenates its arguments into a single string.

procedure

(list$ str)  string?

  str : string?
Returns a list of one-character strings from the given string.

procedure

(str$ n)  string?

  n : any?
Converts a value n to a string.

procedure

(chr$ n)  string?

  n : number?
Converts a given number n to single-character string. If the number is not an integer it will first be coerced to one with int.

procedure

(empty$? str)  boolean?

  str : string?
Returns True if the string is empty ("").

procedure

(len$ str)  number?

  str : string?
Returns the length of the string, indexed from 1.

procedure

(list& l)  string?

  l : list?
Given a list of strings, returns a single concatenated string.

procedure

(head$ str)  string?

  str : string?
Returns the head (first character) of the string.

procedure

(tail$ str)  string?

  str : string?
Returns the tail (remaining characters) of the string, unless str is empty, in which case it returns the empty string.

procedure

(left$ str n)  string?

  str : string?
  n : number?
Returns a string of the leftmost n characters of str.

procedure

(right$ str n)  string?

  str : string?
  n : number?
Returns a string of the rightmost n characters of str.

procedure

(mid$ str idx len)  string?

  str : string?
  idx : number?
  len : number?
Returns a section of str, len characters long, beginning at idx.

procedure

(slice$ str start [finish])  string?

  str : string?
  start : number?
  finish : number? = (len$ str)
Returns a slice of str beginning at start and ending at finish. If not specified, finish defaults to the length of the string.

procedure

(instr str search)  number-or-false?

  str : string?
  search : string?
Returns the index of the first instance of search in str, or False if not found.

procedure

(split str [delimiters])  list?

  str : string?
  delimiters : list? = '(" ")
Returns a list of string sections split at the given delimiters. If delimiters is not specified, defaults to space (" ").

procedure

(format$ template value ...)  string?

  template : string?
  value : any?
Given a string template, returns a new string with instances of glyph "#_" replaced in order, starting with the first value given following the string.