The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Remove Leading Zeros From A Python String With .lstrip()

TODO: Pull subtitle into page object
Code
original = "0001234"
    
stripped = original.lstrip('0')
    
print(stripped)
Results
1234

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Remove Leading Zeros From A Python String With .lstrip()

Passing a zero to `.lstrip()`` will remove leading zeros
instead of trimming leading whitespace

-- code
-- python

original = "0001234"
    
stripped = original.lstrip('0')
    
print(stripped)

-- results/

1234

-- /results


-- list

- Add example of `.lstrip('w.')` or whatever for the
  multiple character strip. 

- Check if doing int() also strips leading zeros

- Either way make a version that turns the
  string into an int


-- categories
-- Python 

-- metadata
-- date: 2017-11-10 07:31:09
-- id: 01byjyk4
-- status: published 
-- type: post 
-- site: aws