31 ESSENTIAL Python String Methods

preview_player
Показать описание
Strings are an essential data type in Python that are used in nearly every application. In this tutorial we learn about the 31 most important built-in string methods.

Get my Free NumPy Handbook:

📓 ML Notebooks available on Patreon:

If you enjoyed this video, please subscribe to the channel:

~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

#Python

Timeline:
00:00 - Intro
00:18 - 1. Slicing
00:40 - 2. strip()
02:10 - 3./4. lstrip() and rstrip()
02:35 - 5./6. removeprefix() and removesuffix()
03:16 - 7. replace()
04:25 - 9. split()
05:02 - 10. rsplit()
05:24 - 11. join()
05:50 - 12./13./14. upper(), lower(), capitalize()
06:07 - 15./16. islower() and isupper()
06:25 - 17./18./19. isalpha(), isnumeric(), isalnum()
07:05 - 20. count()
07:22 - 21. find()
08:07 - 22. rfind()
08:20 - 23./24. startswith() and endswith()
08:35 - 25. partition()
09:04 - 26./27./28 center(), ljust(), rjust()
09:45 - 29. f-Strings
10:26 - 30. swapcase()
10:40 - 31. zfill()

----------------------------------------------------------------------------------------------------------
* This is an affiliate link. By clicking on it you will not have any additional costs, instead you will support me and my project. Thank you so much for the support! 🙏
Рекомендации по теме
Комментарии
Автор

this is great content and format, please bring us more of this kinda summary !!

YM-lmxr
Автор

3:09 Just a note that removeprefix and removesuffix are only available in 3.9 or later.

lawrencedoliveiro
Автор

Great video! I loved the tips, they are very useful!

alyssonmachado
Автор

thank you very much, i just wonder in the minute 2:08 the strip method why doesnt remove the m in the example word, thanks in advance, great great gift your teachings thank you!

tomblankenship
Автор

This is really cool bro. Please make more such useful summaries. Thank you

dhineshbabu
Автор

Great run-through. Will definitely watch again before starting a string-heavy project.

HeyImAK
Автор

Thought I knew the most string methods. But I was wrong! Great video!

Stelaninja
Автор

Thanks you so much...
I am a 1st year college student before to go to the collage I am started to learning computer languages and successful learned c, cpp and entered to learn python and studying but python is not easy to learn comparing to c, cpp. And get exactly stuked at this topic and now I am clear about this so thank you so much... 😄😄😄

vlogofjagathies
Автор

Thank you, some of the methods were unknown to me

name_ne
Автор

4:14 That only works because “s” has no special meaning after “\”. To be safe in general, you should double the backslash, or use a raw string literal.

lawrencedoliveiro
Автор

Awesome! Thank you for the great content!

Автор

It is very useful as my quick reference of string methods, thanks.

justinlee
Автор

very goog video, i learned a lot, thanks

cancan
Автор

1:56 waitt why it didn't remove the m from example, making it exaple?

PrivacyEnt
Автор

Been learning Python for 2 months, watched many great videos, but this is probably the most efficient 10 minutes! Keep up the great work.
I know all this is in official documentation, but it's so much better learning with a narrator and examples. I just wish I found this video earlier as it would save me hours of stackoverflow parsing.

StarFury
Автор

Is there in python something like stringbuffer /stringbuilder?
Correct me if I'm wrong but in Python strings are unmuttable ... not?

kris_maussen
Автор

why did the lstrip remove all the way to r (Arthur: three)?

justaduckcallednerimo
Автор

3. zadatak
n=int(input('upisi prirodan broj'))
r={}
for i in range (n):
x=input()
r.update({len(x):int(x)})
k=list(r.keys())
k.sort()
g={}
for i in k:
g.update({i:r[i]})
print(i, g[i])

gorand
Автор

how about changing replace method, so you can pass list of strings as 1st argument

higheloguy
Автор

1:57 why the m in example is still there?

saintelohim