lower
strip
lstrip
先頭と末尾の空白(または指定した文字)を除去します。
str.strip(chars?)
下記の値を入力するとサンプルに即時反映されます。
print
text = " hello world " print(text.strip()) # "hello world" print("***hi***".strip("*")) # "hi"