Online Courses
Free Tutorials  Go to Your University  Placement Preparation 
Goeduhub's Online Courses @ Udemy in Just INR 570/-
Online Training - Youtube Live Class Link
0 like 0 dislike
183 views
in Python Programming by Goeduhub's Expert (3.1k points)

Goeduhub's Top Online Courses @Udemy

For Indian Students- INR 360/- || For International Students- $9.99/-

S.No.

Course Name

 Coupon

1.

Tensorflow 2 & Keras:Deep Learning & Artificial Intelligence

Apply Coupon

2.

Natural Language Processing-NLP with Deep Learning in Python Apply Coupon

3.

Computer Vision OpenCV Python | YOLO| Deep Learning in Colab Apply Coupon
    More Courses

1 Answer

0 like 0 dislike
by Goeduhub's Expert (3.1k points)
 
Best answer

strip() method python 

strip method in python is a in-built python function used to return a copy of string with removing start and end spaces of string.

Some Examples 

#strip function example

txt = "     goeduhub Technologies    "

x = txt.strip()

print(x)

Output

goeduhub Technologies

Note: In example you can see you can see that start and end spaces of string are removed.

Strip function/ method with parameter 

#example of strip function 

txt = " rrrree  Python bcsrrreeee re   "

x = txt.strip(" re")

print(x)

Output

Python bcs

Note: Note that if we use a strip function with parameter it will  remove that particular match. And if we use simple strip function it will remove leading and trailing spaces (start and end).

3.3k questions

7.1k answers

394 comments

4.6k users

Related questions

0 like 0 dislike
1 answer 326 views
0 like 0 dislike
2 answers 206 views
0 like 0 dislike
1 answer 3k views
0 like 0 dislike
1 answer 1.9k views

 Goeduhub:

About Us | Contact Us || Terms & Conditions | Privacy Policy || Youtube Channel || Telegram Channel © goeduhub.com Social::   |  | 
...