Skip to content

substring

relationalai.semantics.std.strings
substring(s: StringValue, start: IntegerValue, stop: IntegerValue) -> Expression

Get the substring of s from start to stop (0-based, stop exclusive).

  • s

    (StringValue) - The string to extract from.
  • start

    (IntegerValue) - The starting index (0-based, inclusive).
  • stop

    (IntegerValue) - The ending index (0-based, exclusive).
  • Expression - An Expression representing the extracted substring. Returns String.

Extract a substring from a string:

>>> strings.substring(Person.name, 0, 3)
>>> strings.substring("example", 2, 5)