This code will return the first 5 words, change the number in the regular expression as needed:
string testString = "The quick brown fox jumps over the lazy dog."string firstWords = Regex.Match(testString, @"^(\w+\b.*?){5}").ToString();
posted @ Friday, December 16, 2011 11:03 AM
Title:
Name:
Email: Not Displayed
Website:
Comment: