📜  没有拆分功能的分离字符串python代码示例

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

代码示例1
new_list = []
for sentence in old_list:
    word = ''
    for ch in sentence:
        if ch == ' ' and word != '':
            new_list.append(word)
            word = ''
        else:
            word += ch
    if word != '':
        new_list.append(word)