我将如何抓住'\id '
字符串中的第一个单词?
细绳:
'\id hello some random text that can be anything'
Python
for line in lines_in:
if line.startswith('\id '):
book = line.replace('\id ', '').lower().rstrip()
我得到了什么
book = 'hello some random text that can be anything'
我想要的是
book = 'hello'