To trim a string in Python you can use the following snippet.
Sample Python
input = " HelloWorld "
input.strip() # returns "HelloWorld"
input.lstrip() # returns "HelloWorld "
input.rstrip() # returns " HelloWorld"
input.replace(' ', '') # returns "HelloWorld"
RT @CodeSnippetsNET: Trim a string in #Python http://t.co/4LqYb3h2Xd #programming #code #coding #dev #develop #developer