menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

How to Str...
source image

Medium

2w

read

160

img
dot

Image Credit: Medium

How to Strip Characters From a Python String

  • Python provides the .strip() method to remove characters from the beginning and end of a string.
  • To remove characters from only one side of a string, use .lstrip() or .rstrip().
  • You can pass a string of characters to .strip(), .lstrip(), or .rstrip(). This tells Python what characters to remove.
  • NOTE: This does not remove the exact sequence “///”. Instead, it removes all instances of the characters '/' from…

Read Full Article

like

9 Likes

For uninterrupted reading, download the app