![]() ![]() To find the count of words, characters, and pages, at the top of the page, click Tools Word count. On your computer, open a document in Google Docs. ![]() Tip: Use this feature for long documents, like novels or screenplays. This code should work better with cases where you have multiple spaces between each word, you can test the code online. Count the number of words in a long document. While (index < text.Length & !char.IsWhiteSpace(text)) check if current char is part of a word While (index < text.Length & char.IsWhiteSpace(text)) Take a look at the status bar in the bottom and it’ll say XX of YY words. Word also counts pages, paragraphs, lines, and characters. You can select as many blocks of text as you want in any pages of the document. Count the number of words in a long document On your computer, open a document in Google Docs. 500 216K views 3 years ago Microsoft Word 101 Microsoft Word counts the number of words in a document while you type. Select the text that you want to find the word count for. Otherwise, use an algorithm similar to this: int wordCount = 0, index = 0 Right-click on your Word document, select Open with, and choose Word. If you really want to use String.Split, then go for a simpler version like Yonix recommended. For each word in your text, a new String object needs to be instantiated, and then soon collected since you are not using it.įor a homework assignment, this may not matter, but if your text box contents change often and you do this calculation inside an event handler, it may be wiser to simply iterate through characters manually. All you need to do is highlight the text for which you want a count and then press on the Word Count to open up the pop up stats menu. The Word Count dialog box displays, as shown in the image at the beginning of this document. String.Split is handy, but it unnecessarily generates a (potentially) large number of String objects, which in turn creates an unnecessary burden on the garbage collector. In the Proofing section, click Word Count. Since you are only interested in word count, and you don't care about individual words, String.Split could be avoided. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |