Python문자열strip
lower

strip문자열

lstrip

앞뒤 공백(또는 지정 문자)을 제거합니다.

문법

str.strip(chars?)

예제

아래 값을 입력하면 예제에 즉시 반영됩니다.

print
strip
text = "  hello world  "
print(text.strip())   # "hello world"
print("***hi***".strip("*"))  # "hi"