Finsihed a Python like split function.