Python 字符串 istitle() 方法

2024年9月5日 | 1 分钟阅读

如果字符串是标题格式的字符串,Python istitle() 方法返回 True。否则返回 False。

签名

参数

不需要参数。

返回

它返回 True 或 False。

让我们看一些 istitle() 方法的例子来理解它的功能。

Python 字符串 istitle() 方法示例 1

这是一个简单的例子来理解

Python 字符串 istitle() 方法示例 2

输出

True
False

Python 字符串 istitle() 方法示例 3

输出

Not in title case
In title case
Not in title case

下一个主题Python 字符串