Latest web development tutorials

파이썬 lstrip () 메소드

파이썬 문자열 파이썬 문자열


기술

파이썬 lstrip () 메서드는 공백이나 왼쪽에 지정된 문자열을 잘라하는 데 사용됩니다.

문법

lstrip () 메서드 구문 :

str.lstrip([chars])

매개 변수

  • 문자 - 촬영 지정된 문자.

반환 값

후 지정된 비어 또는 절단 된 문자열을 결과로 새로운 캐릭터 라인을 돌려줍니다.

다음의 예는 ()를 사용하는 lstrip 보여줍니다

#!/usr/bin/python

str = "     this is string example....wow!!!     ";
print str.lstrip();
str = "88888888this is string example....wow!!!8888888";
print str.lstrip('8');

다음, 상기 출력 결과의 예 :

this is string example....wow!!!
this is string example....wow!!!8888888

파이썬 문자열 파이썬 문자열