📜  获取字符串直到字符python代码示例

📅  最后修改于: 2022-03-11 14:46:31.690000             🧑  作者: Mango

代码示例1
s = "first_second"
s.split('_')[0] # Split the string on '_' return the first part. 
>>> 'first'