This post will discuss how to remove the first character from a string in Python.

1. Using Slicing

A simple approach to remove the first character from a string is with slicing. Here’s how the code would look like:

Download  Run Code

 
If you want to remove the first n characters, you can do:

Download  Run Code

 
If you want to remove a character at a specific position, you can do:

Download  Run Code

2. Using split() function

If you need to remove the first occurrence of the given character, you can use the split function with join. This would translate to a simple code below:

Download  Run Code

3. Using lstrip() function

If you need to remove all occurrence of a leading character, you can use the lstrip function:

Download  Run Code

That’s all about removing the first character from a string in Python.