traecer 🌊traecer@techhub.social
Sep 17, 2025, 12:21 PM@phl
split() does indeed allow you to split a string by a pattern. It will return a list of values from the string that were separated by that pattern. So you are effectively getting the pieces that *don't* match the pattern in the returned list, because the pattern was what the string was split on.
split() also accepts a string as a separator, if you don't need the complication of a pattern.