Method: Polars::StringExpr#split
- Defined in:
- lib/polars/string_expr.rb
#split(by, inclusive: false, literal: true, strict: true) ⇒ Expr
Split the string by a substring.
1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 |
# File 'lib/polars/string_expr.rb', line 1253 def split(by, inclusive: false, literal: true, strict: true) by_rbexpr = Utils.parse_into_expression(by, str_as_lit: true) if !literal if inclusive return Utils.wrap_expr( _rbexpr.str_split_regex_inclusive(by_rbexpr, strict) ) end return Utils.wrap_expr(_rbexpr.str_split_regex(by_rbexpr, strict)) end if inclusive return Utils.wrap_expr(_rbexpr.str_split_inclusive(by_rbexpr)) end Utils.wrap_expr(_rbexpr.str_split(by_rbexpr)) end |