← replace operator page · string/replace/sc_two/leading_word_replaced
pandas ✅ · DuckDB ✅
replace(SC_1, SC_2, SC_3) with SC_1 = Hello world, SC_2 = Hello and SC_3 = Hi, where the pattern is the first word.
String pattern replacement: "Replaces all the occurrences of a specified string-pattern (pattern1) with another one (pattern2).", as in replace("Hello world", "Hello", "Hi") gives "Hi world".
SC_r is Hi world, a String.
SC_r := replace(SC_1, SC_2, SC_3);
| SC_1 | SC_2 | SC_3 |
|---|---|---|
| Hello world | Hello | Hi |
{
"scalars": [
{"name": "SC_1", "type": "String"},
{"name": "SC_2", "type": "String"},
{"name": "SC_3", "type": "String"}
]
}
{
"scalars": [
{"name": "SC_r", "type": "String", "value": "Hi world"}
]
}