1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/字符串中的单词数 [number-of-segments-in-a-string].html
2022-03-29 12:43:11 +08:00

11 lines
448 B
HTML

<p>统计字符串中的单词个数,这里的单词指的是连续的不是空格的字符。</p>
<p>请注意,你可以假定字符串里不包括任何不可打印的字符。</p>
<p><strong>示例:</strong></p>
<pre><strong>输入:</strong> &quot;Hello, my name is John&quot;
<strong>输出:</strong> 5
<strong>解释: </strong>这里的单词是指连续的不是空格的字符,所以 &quot;Hello,&quot; 算作 1 个单词。
</pre>