String methods in Python part 3 lesson 22 | lstrip, rstrip, strip, replace, rfind, find, rindex

Опубликовано: 24 Март 2026
на канале: ifactner
623
8

This tutorial teaches you how to use important string methods including lstrip, rstrip, strip, replace, rfind, find, rindex in Python. This is lesson 23 of Python for beginners in Hindi Urdu course.
Watch also:
Part 1 - Python String methods for beginners capitalize casefold center endswith find index islower isnumeric at    • Python String methods for beginners capita...  

Prt 2 - String methods in Python | isalpha, isdigit, isprintable, islower, isupper, istitle, lower at    • String methods in Python part 2 |  isalpha...  

Following code is written in this Python for beginners in Hindi Urdu tutorial:
String methods (part 3)
st = " Welcome "
print(st)
print(st.lstrip() + " Hi")
print(st.rstrip() + " Hi")
print(st.strip() + " Hi")
st1 = "Hello Jan. How are you Jan."
st2 = st1.replace("Hello", "Bye")
print(st1)
print(st2)
print(st1.rfind("Jan"))
print(st1.find("Jan"))
print(st1.rindex("Jan"))