
In this Python 3.7 tutorial we will look at the lstrip string method in Python. For the full tutorial and code examples visit https://www.mastercode.online/courses... Transcript: Hello and welcome back to another Python tutorial my name is Tom with master code online as always don't forget to like share and subscribe to my channel and today tutorial we're going to go ahead and take a look at the lstrip string method or the left strip string method. What the lstrip string method does try to say that 10 times fast it removes a set of characters from the left side of the string when did method meets a character does not recognize it stops looking for the set of characters are removed from the left side so just go ahead and take a look at it I'll show you. What it does as a default if we pass no argument we're going to remove the white space from the left hand side of the string so we'll do egg. The strip string method like this and no argument and will move remove the white space in the left side of the string. Now. Razor saw this method often when I'm working with your routes are especially in a Django project to wear a user ads URL we want to go ahead and sanitize it so the way we do that is Tom I'll show you what's a is equal to a year Elmo say HTTP colon forward slash forward slash www master code. Online. Alright so now we what we want to do is we want to remove let's go ahead and remove the HTTP colon forward slash forward slash first we'll see how we do that so A. L strip. And I will inside a stream we're going to put a set of characters HTTP colon forward slash. Now noticed that I put one tee but there's two I put 1/4 / but there's two it will remove any characters that match that until it hits a characters not in this set of characters down here. It's going to stop looking any further and return www. Massacre. Online they returned and there you go. Let's go and take a look at that real quick and tell strip like this HTTP colon. 4 / W. Close out that string close out that return and there you go if you guys have any questions head over to master code. Online and here's our URL right here let us know there. Otherwise we'll see next tutorial.
Python 3.7: Lstrip String Method - YouTube |
| 5 Likes | 5 Dislikes |
| 175 views views | 14,790 followers |
| Education | Upload TimePublished on 12 Aug 2018 |
python tutorials point,python tutorials pdf,python tutorials point pdf,python tutorials for beginners,python tutorials advanced,python tutorials video,python tutorials best,python tutorials opencv,python tutorials django,python tutorials basic,python tutorials gui,python tutorialspoint list,python tutorialspoint regex,python tutorialspoint tkinter,python tutorials for beginners pdf,python tutorials youtube,python tutorials online,python tutorials w3schools,tutorialspoint python class,tutorials python 3
Không có nhận xét nào:
Đăng nhận xét