Skip to content

Instantly share code, notes, and snippets.

@dichharai
Last active February 5, 2023 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dichharai/bd55dbe582b237ed6437170e1138888d to your computer and use it in GitHub Desktop.
Save dichharai/bd55dbe582b237ed6437170e1138888d to your computer and use it in GitHub Desktop.
Method/Attribue Purpose
split() Split the string into a list; splitting it whenever the RE matches
sub() Find all substrings where the RE matches and replace them with a different string
subn() Does the same thing as sub() but returns the new string and the number of replacements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment