📜  在没有 split() 的情况下在 Python 中拆分字符串 - Python 代码示例

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

代码示例1
sentence = 'This is a sentence'
word=""
for w in sentence :
    if w.isalpha():
        word=word+w

    elif not w.isalpha():
      print(word)
      word=""
print(word)