String.contains? / String.replace / String.split
Searching, replacing, and splitting.
Syntax
String.contains?(s, "x") String.replace(s,"a","b") String.split(s,",")
Description
contains? tells whether a substring exists (true/false). replace swaps parts, split divides into a list.
Example
Loading editor…
Expected output
true 2024/01 ["a", "b", "c"]
When to use?
Search box, text sanitization, CSV parsing.