Languages
[Edit]
EN

Python - remove first character from string

0 points
Created by:
marc_so
504

In this article, we would like to show you how to remove the first character from the string in Python.

Quick solution:

text = 'Dirask is awesome!'
result = text[1:]  # removes the first character
print(result)  # irask is awesome!

 

Practical example

In this example, we use string slicing to remove the first character from the text string.

text = 'Dirask is awesome!'

# removes the first character
result = text[1:]

print(result)  # irask is awesome!

Output:

irask is awesome!

Related posts

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

â€ïžđŸ’» 🙂

Join