Python .string and it functions
Python String
>>> Python .string
>>> Source Code :
str="Har Har Mahadev"
print(len(str)) #It's teel about the length of string
print(str[0:3])
print(str[8:15])
print(str[0:89])
print(str[8:15:2])
print(len(str)) #It's teel about the length of string
print(str[0:3])
print(str[8:15])
print(str[0:89])
print(str[8:15:2])
print(str[0:]) # ==print(str[0:15])
print(str[:4]) # ==print(str[0:4])
print(str[::]) # ==print(str[0:15:1])
print(str[::2]) # ==print(str[0:15:2])
print(str[::567])
print(str[::-1])
print(type(str))
print(str.isalpha() #alpha is a string that's does't contain space and integer
print(str.isnumeric()) #numeric does't contain space and character
print(str.isalnum()) #alnum contain alphabet and numbers but does't contain space
print(str.endswith("dev"))
print(str.count("H"))
print(str.capitalize()) # It is use for captilize 1st Word of string
print(str.find("Har")) #It is use for finding word in string
print(str.lower())
print(str.upper())
print(str.replace("Har","Jai"))#It is use for replacing word
print(str.format_map("Har"))
>>> Click Here for more Source-Codes :)
: ) if you have any doubt in Python .string thetact Contact Us : )
Python .string and it functions
Reviewed by Coding Guy
on
July 07, 2019
Rating:
No comments: