How does strip method work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How does strip method work?

name="Heyli kh ".Rstrip() which part is wrong?

3rd Jul 2022, 1:09 PM
Aida.Khandani
2 Answers
+ 3
strip() removes leading and trailing spaces from a string.. rstrip() removes trailing (rightmost side) spaces.. (Use Small r) lstrip() removes leading (leftmost side) spaces.. Check : print( " Heyli kh ".strip()) print( " Heyli kh ".rstrip()) print( " Heyli kh ".lstrip())
3rd Jul 2022, 1:24 PM
Jayakrishna 🇮🇳
+ 2
Thanks all of you👍💜 Ipang Jayakrishna🇮🇳
3rd Jul 2022, 4:12 PM
Aida.Khandani