Remove the first character of a string

后端 未结 5 593
萌比男神i
萌比男神i 2020-12-07 21:38

I would like to remove the first character of a string.

For example, my string starts with a : and I want to remove that only. There are several occurre

5条回答
  •  轮回少年
    2020-12-07 22:13

    python 2.x

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

    python 3.x

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

    both prints

    dfa:sif:e
    

提交回复
热议问题