Find and Use standard string methods Python 3


show more Finding and using standard string methods provides you with in-depth training on Developer. Taught by Bill Weinman as part of the Python 3 Essential Training show less
please wait ...

Finding and using standard string methods

Python has an extremely rich set of string methods, over 40 of them last I counted. What we've covered here are the essential ones. And I'd like show you how to find the rest of them and how to use them. It's really quite straightforward. Here we have the Python documentation page or the Python Standard Library. And we'll notice this is section 5, Built-in Types. And down here we see this link of 5.6.1 String Methods. And here's a complete list of all the string methods. Like for example, here is this center one.

And we see that center it takes with and an optional fill character and it returns a centered string of length width. And padding is done using this specified fill character. Default is a space. So if I had a string, 'this is a string', and I wanted to center it on say 80 character string, I would simply say new = s.center(80) like that. And now I have a new string. And we see that this new string is 80 characters wide. I can check if I want to. length o...

Finding and using standard string methods
Video duration: 1m 45s 6h 36m Beginner

Viewers:

Finding and using standard string methods provides you with in-depth training on Developer. Taught by Bill Weinman as part of the Python 3 Essential Training

Subjects:
Developer Web
Software:
Python
Author:
please wait ...