Get distinct words from a file c#

  • Thread starter Thread starter Carlo Goretti
  • Start date Start date
C

Carlo Goretti

Guest
Hey!

I need help to get all distinct words that starts with Momentum_ in the beginning of the word.

foreach (var f in files)
{
string content = File.ReadAllText(f);

string pattern = "Momentum_";
MatchCollection matches = Regex.Matches(content, pattern, RegexOptions.Singleline);
foreach (Match match in matches)
{
MessageBox.Show(match.Groups["Momentum_"].ToString());
}
Console.ReadLine();
//if (content.Contains(HittaTxt.Text))
//{
// content = content.Replace(HittaTxt.Text, ErsättTxt.Text);
// File.WriteAllText(f, content);

//}
}

Any ideas? Thankful for help!

Continue reading...
 

Similar threads

Back
Top