Method: Polars::StringExpr#replace
- Defined in:
- lib/polars/string_expr.rb
#replace(pattern, value, literal: false, n: 1) ⇒ Expr
Replace first matching regex/literal substring with a new string value.
1375 1376 1377 1378 1379 |
# File 'lib/polars/string_expr.rb', line 1375 def replace(pattern, value, literal: false, n: 1) pattern = Utils.parse_into_expression(pattern, str_as_lit: true) value = Utils.parse_into_expression(value, str_as_lit: true) Utils.wrap_expr(_rbexpr.str_replace_n(pattern, value, literal, n)) end |