Skip to content

strip

relationalai.semantics.std.strings
strip(s: StringValue) -> Expression

Strip whitespace from both ends of the string s.

  • Expression - An Expression representing the string with leading and trailing whitespace removed. Returns String.

Remove whitespace from both ends of a string:

>>> select(strings.strip(Person.name))
>>> select(Text.content).where(strings.strip(Text.content) == "string with spaces")
RelationalAI Documentation
└──  Build With RelationalAI
    └──  Understand how PyRel works > Use advanced reasoning > Rules-based reasoning
        └──  Work with strings
            └──  Normalize text before comparisons