string_length

Declaration

string_length (text: STRING): INTEGER

Description

Returns the number of characters in text. Use this with substring and string_pos to make sure the string is long enough.

See Also

substring
string_pos
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