substring

Declaration

substring (text: STRING; start, count: INTEGER): STRING

Description

Returns the count characters of text beginning with the start character. Indexes are 1-based.

See Also

string_pos
string_length
string functions

Example

script cut_strings is
  str := 'test'
  pos := string_pos (str, 't', 1)
    -- pos = 1
  if (pos > 0) then
    s := substring (str, pos, string_length (str) - pos)
      -- s == 'est'
    pos := string_pos (s, 't')
      -- pos = 3
  end
end