📜  python if string 有空格 - Python 代码示例

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

代码示例10
In [1]: import re

In [2]: string = "Hello world"

In [3]: bool(re.search('\s', string))
Out[3]: True

In [4]: string = "World"

In [5]: bool(re.search('\s', string))
Out[5]: False