Skip to content

join

relationalai.semantics.std.strings
join(strs: Sequence[StringValue], separator: str = "") -> Expression

Join a sequence of strings with a separator.

  • strs

    (Sequence[StringValue]) - A sequence of string values to join.
  • separator

    (str, default: "") - The separator to use between strings.
  • Expression - An Expression representing the joined string. Returns String.

Join strings with various separators:

>>> strings.join(["FIRST", "MIDDLE", "LAST"]) # defaults to empty string separator
>>> strings.join([Person.first, Person.last], " ")
>>> strings.join([Person.first, "the best", Person.last], " | ")
RelationalAI Documentation
└──  Build With RelationalAI
    └──  Understand how PyRel works > Use advanced reasoning > Rules-based reasoning
        └──  Work with strings
            └──  Build derived text values