0% found this document useful (0 votes)
31 views1 page

Strip Method

The document describes four methods to remove spaces from a string variable: lstrip() removes leading spaces, rstrip() removes trailing spaces, strip() removes both leading and trailing spaces, and replace() removes all spaces.

Uploaded by

Himanshu agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views1 page

Strip Method

The document describes four methods to remove spaces from a string variable: lstrip() removes leading spaces, rstrip() removes trailing spaces, strip() removes both leading and trailing spaces, and replace() removes all spaces.

Uploaded by

Himanshu agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

STRIP METHOD

To remove spaces store in the variable.

Name = “Hima nshu”

1) To remove space on the left time

Name.lstrip()

2) To remove space on the right side

Name.rstrip()

3) To remove both

Name.strip()

4) To remove all spaces

Name.replace(“ ” , “”)

You might also like