replace
relationalai.semantics.std.strings
replace(source: StringValue, old: StringValue, new: StringValue) -> ExpressionReplace occurrences of old with new in the string source.
Parameters
Section titled “Parameters”
(sourceStringValue) - The original string.
(oldStringValue) - The substring to replace.
(newStringValue) - The replacement substring.
Returns
Section titled “Returns”Expression- AnExpressionrepresenting the string with replacements applied. ReturnsString.
Examples
Section titled “Examples”Replace substrings within a string:
>>> strings.replace("My-name", "-", "_")>>> strings.replace(Brand.name, "bee", "")Referenced By
Section titled “Referenced By”RelationalAI Documentation └── Build With RelationalAI └── Understand how PyRel works > Use advanced reasoning > Rules-based reasoning └── Work with strings └── Build derived text values