WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center

WordCount ["string"]

gives the total number of words in string.

Details
Details and Options Details and Options
Examples  
Basic Examples  
Properties & Relations  
Neat Examples  
See Also
Related Guides
History
Cite this Page

WordCount ["string"]

gives the total number of words in string.

Details

  • Character sequences in "string" that are not identified as being part of words are excluded from WordCount .

Examples

open all close all

Basic Examples  (1)

Count the number of words in a string:

Properties & Relations  (2)

The empty string has 0 words:

Hyphenated words are treated as a single word:

Neat Examples  (1)

Find the sentence with the most words in a book:

Compare to the longest sentence by string length:

Wolfram Research (2015), WordCount, Wolfram Language function, https://reference.wolfram.com/language/ref/WordCount.html.

Text

Wolfram Research (2015), WordCount, Wolfram Language function, https://reference.wolfram.com/language/ref/WordCount.html.

CMS

Wolfram Language. 2015. "WordCount." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/WordCount.html.

APA

Wolfram Language. (2015). WordCount. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WordCount.html

BibTeX

@misc{reference.wolfram_2025_wordcount, author="Wolfram Research", title="{WordCount}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/WordCount.html}", note=[Accessed: 04-December-2025]}

BibLaTeX

@online{reference.wolfram_2025_wordcount, organization={Wolfram Research}, title={WordCount}, year={2015}, url={https://reference.wolfram.com/language/ref/WordCount.html}, note=[Accessed: 04-December-2025]}

Top [フレーム]

AltStyle によって変換されたページ (->オリジナル) /