title: String split with default delimiter vs user defined delimiter
body: <p>I tried a simple example with string split, but get some unexpected behavior. Here is the sample code:</p>
  
  <pre><code>def split_string(source,splitlist):
      for delim in splitlist:
          source = source.replace(delim, ' ')
      return source.split(' ')
  
  out = split_string("This is a test-of the,string separation-code!", " ,!-")
  print out
  &gt;&gt;&gt; ['This', 'is', 'a', 'test', 'of', 'the', 'string', 'separation', 'code', '']
  </code></pre>
  
  <p>As you can see, I got an extra empty string at the end of the list when I use space as delimiter argument for split() function. However, if I don't pass in any argument for split() function, I got no empty string at the end of the output list.</p>
  
  <p>From what I read in python docs, they said the default argument for split() is space. So, why when I explicitly pass in a ' ' as delimiter, it creates an empty string at the end of the output list? </p>