actually the proper regex should be:
 
@"\bHello\b"
 
----------------------------------
Peace and love,
Tweety
[EMAIL PROTECTED] - [EMAIL PROTECTED]
YahooID: tweety_04_01


From: Mohamed Galal [mailto:[EMAIL PROTECTED]
Sent: Friday, September 24, 2004 7:40 AM
To: [EMAIL PROTECTED]
Subject: Re: [Microsofts_C_Sharp] word_counter

hi
 
consider using this...
 
//@ the top
using System.Text.RegularExepressions
 
//inside a function
 
RegEx regex = new RegEx("Hello");
MatchCollection mc = regex.Matches(textBox1.Text);
MessageBox.Show(mc.Count);
 
hope this helps...
 
Mohamed Galal
 
 


shaheener <[EMAIL PROTECTED]> wrote:
i wanna make a c# program that counts the no. of words in a
sentence. i used the ".Length" method but this only counts the no.
of charcters. So please if anyone got the idea to count words i'd
appreciate it if he posted it.



Do you Yahoo!?
vote.yahoo.com - Register online to vote today!

Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to