tia_kamakshi
asked on
Word Count using Regular Expression
Hi,
How do we Word Count in Text from regular Expression. I am working on C#, ASP 2.0
Can we find and Replace Text using in Regular Expression and finally gives replace text count
public static int WordCount(string orignalTxt, string strTextToFindAndCount, string strReplaceText)
{
int wordReplacedCount =0;
return wordReplacedCount;
}
Many Thanks
How do we Word Count in Text from regular Expression. I am working on C#, ASP 2.0
Can we find and Replace Text using in Regular Expression and finally gives replace text count
public static int WordCount(string orignalTxt, string strTextToFindAndCount, string strReplaceText)
{
int wordReplacedCount =0;
return wordReplacedCount;
}
Many Thanks
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
I guess I would have you test it with your source file.
you can do with 25 MB, just read the file line by line, and use the code that ddrudik suggested, accumulating the counts.
ASKER
But I need to put about 25 MB of file to find the word count.
Is the Regular Expression feasible. If yes can you please help me with the code which suits me in the method
public static int WordCount(string orignalTxt, string strTextToFindAndCount, string strReplaceText)
{
int wordReplacedCount =0;
return wordReplacedCount;
}
Thanks again