Python Split String

前端 未结 7 2042
名媛妹妹
名媛妹妹 2020-12-06 17:42

Lets Say we have Zaptoit:685158:zaptoit@hotmail.com

How do you split so it only be left 685158:zaptoit@hotmail.com

7条回答
  •  忘掉有多难
    2020-12-06 17:59

    Following splits the string, ignores first element and rejoins the rest:

    ":".join(x.split(":")[1:])
    

    Output:

    '685158:zaptoit@hotmail.com'
    

提交回复
热议问题