FIND YOUR NEXT FEW LINES
The snippet library.
Small, practical examples. Search by task or narrow things down below.
5 snippets foundClear filters
Extract numbers from text
Find all runs of ASCII digits in a string and convert the matches to integers.
regex✓ Tested
Join strings with a separator
Combine a list of strings into one readable string with a separator between each item.
string✓ Tested
Parse and format a date
Convert a date string into a datetime object, then format it in a different, human-readable order.
date✓ Tested
Replace text in a string
Replace every occurrence of a substring and keep the result in a new string. The original string is unchanged.
string✓ Tested
Split a string into words
Split text on whitespace, automatically treating repeated spaces, tabs, and line breaks as a single separator.
string✓ Tested