I am Hack Sparrow
Captain of the Internets.

Python: split string method and examples

So you are looking to break up a string into smaller strings (in an array if you are coming from a PHP / JavaScript background) based on a delimiter or character. Python provides a very straightforward and easy function to do that. The function is called split, it returns a list as the result (you really don't want to a Python array for this one) and here are some examples. Examples 1 to 3 are to be tri ...