Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Remove the First Character From the String in Python Using the Slicing

greeting = "HHello world!"
new_greeting = greeting[1:]
# In here we select greeting string from character 1 to end (except character 0)
print(new_greeting)
#output: Hello world!
Comment

how to remove first letter of a string python

s = "hello"
print s[1:]
Comment

remove first character from string python

s = ":dfa:sif:e"
print(s[1:])

prints:
  dfa:sif:e
Comment

remove first character of string python

r = "hello"
r = r[1:]
print(r) # ello
Comment

PREVIOUS NEXT
Code Example
Python :: read all text file python 
Python :: python transpose list 
Python :: view point cloud open3d 
Python :: write to file python 3 
Python :: python named tuple 
Python :: python get financial data 
Python :: sum all values of a dictionary python 
Python :: How to log a python crash? 
Python :: error warning tkinter 
Python :: matplotlib add legend axis x 
Python :: print last n rows of dataframe 
Python :: how to print something with tkinter 
Python :: mario dance dance revolution 
Python :: sorted python lambda 
Python :: tkinter button background color mac 
Python :: python legend outside 
Python :: leap year algorithm 
Python :: import python module from another directory 
Python :: migrate using other database django 
Python :: python delete the last line of console 
Python :: convert period to timestamp pandas 
Python :: except index out of range python 
Python :: how to draw polygon in tkinter 
Python :: replace url with text python 
Python :: python gtts 
Python :: numpy apply log to array 
Python :: python check list contains another list 
Python :: how to make square shape python 
Python :: debugar python 
Python :: how to run a function in interval in python 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =