Skip to content

Instantly share code, notes, and snippets.

@harunyasar
Created July 3, 2015 12:24
Show Gist options
  • Save harunyasar/c5148d7e49636993d4a0 to your computer and use it in GitHub Desktop.
Save harunyasar/c5148d7e49636993d4a0 to your computer and use it in GitHub Desktop.
String formatting with % and stripping
a = " Lorem ipsum"
b = " "
("%s %s" % (a , b)).strip() # 'Lorem ipsum'
"%s %s" % (a , b) # ' Lorem ipsum '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment