substr(text, number)

substr(text, number), function

def const pure substr(source: text, start: number): text

Returns a sub-value from a source text, and a starting position.

Examples

source = "Hello World!"
show summary "" a1a4 with
  substr(source, 0)  // returns "Hello World!"
  substr(source, -3) // returns "ld!"
  substr(source, 6) // returns "World!"
  substr(source, 100) // returns ""

Remarks

If source is shorter than start characters, the function will return an empty text (as illustrated hereinabove).

substr(source, start) is equivalent to substr(source, start, +infinity).

See also

User Contributed Notes
0 notes + add a note