RichTextbox word count????
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
5 posts
Page 1 of 1
i have a richtextbox1 and a textbox1
i want the textbox1 to display how many words are inside the richtextbox.
but idk the code : ((
i want the textbox1 to display how many words are inside the richtextbox.
but idk the code : ((
Here you go hope it works. cooll;
Download:
Download:
You do not have the required permissions to view the files attached to this post.
Smiley wrote:Here you go hope it works. cooll;thanks for the try man.. but thats letter counting.. im looking for word counting. -__-
Download:
Try:
Code: Select all
Dim spaceArray As String() = RichTextBox1.Text.Replace(vbLf, " ").Split(" "c)
Dim wordcount As Integer = 0
For i As Integer = 0 To spaceArray.Length - 1
If spaceArray(i).Length > 0 Then wordcount += 1
Next
MsgBox(wordcount & " words found")
mandai wrote:Try:Code: Select allDim spaceArray As String() = RichTextBox1.Text.Replace(vbLf, " ").Split(" "c) Dim wordcount As Integer = 0 For i As Integer = 0 To spaceArray.Length - 1 If spaceArray(i).Length > 0 Then wordcount += 1 Next MsgBox(wordcount & " words found")
AWESOME IT WORKED. THANKS MANDAI : )
5 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023