Add str.replace
xhochy opened this issue · comments
- ✔️ pandas function
- ✔️ Python function
- ❌ C++ STL function
- ❌ needs a regular expression library
- ? maybe needs a Unicode database
- ❌ cannot pre-compute output size
replace(…, regex=False)
is a simpler case and can done without a regex library.
Pseudo-Code:
Inputs: pat, repl, n, case, regex
builder = StringBuilder()
for row in rows:
if isnull(row)
builder.addnull()
else:
if regex:
builder.add(re.sub(pat, row, repl))
else:
builder.add(row.sub(pat, repl))