Metode string
1. capitalize()
capitalize()text = "python programming"
print(text.capitalize()) # Output: "Python programming"2. casefold()
casefold()text = "Straße"
print(text.casefold()) # Output: "strasse"3. center(width, fillchar)
center(width, fillchar)text = "Python"
print(text.center(10, "-")) # Output: "--Python--"4. count(substring)
count(substring)5. encode(encoding='utf-8')
encode(encoding='utf-8')6. endswith(suffix)
endswith(suffix)7. find(substring)
find(substring)8. index(substring)
index(substring)9. isalnum()
isalnum()10. isalpha()
isalpha()11. isdecimal()
isdecimal()12. isdigit()
isdigit()13. isidentifier()
isidentifier()14. islower()
islower()15. isnumeric()
isnumeric()16. isspace()
isspace()17. istitle()
istitle()18. isupper()
isupper()19. join(iterable)
join(iterable)20. lower()
lower()21. lstrip()
lstrip()22. partition(separator)
partition(separator)23. replace(old, new)
replace(old, new)24. rstrip()
rstrip()25. split(separator)
split(separator)26. strip()
strip()27. swapcase()
swapcase()28. title()
title()29. upper()
upper()Kesimpulan
Last updated