python remove first and last character from string

414

remove first character from string python -

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

prints:
  dfa:sif:e

remove first character of string python -

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

Comments

Submit
0 Comments