In #Python you can use textwrap.dedent to remove any common leading whitespace from every line in text (thanks @brianokken)
Check it out!
def test():
# end first line with \ to avoid the empty line!
s = '''\
hello
world
'''
print(repr(s)) # prints ' hello\n world\n '
print(repr(dedent(s))) # prints 'hello\n world\n'