Python Split String

前端 未结 7 2036
名媛妹妹
名媛妹妹 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

    Use the method str.split() with the value of maxsplit argument as 1.

    mailID = 'Zaptoit:685158:zaptoit@hotmail.com' 
    mailID.split(':', 1)[1]
    

    Hope it helped.

提交回复
热议问题