Try to search your question here, if you can't find : Ask Any Question Now ?

I want to get only next 5 words after my character is matched

HomeCategory: stackoverflowI want to get only next 5 words after my character is matched
pushpa asked 2 weeks ago

I am using regex in C#. I want to get only next 5 characters after my string has been matched.

Regex regex = new Regex("Born(.*){0,5}");
string result = regex.Match(UrlString).Value;`

First of all i need to to find the word “Born”. Then i need to get next 5 words after the word “Born” has been found.

Example-Born to a Gujarati family in Vadnagar, Modi helped his father sell tea as a child and later ran his own stall.

But i am not getting the desired result.

1 Answers
Best Answer
Fernando answered 2 weeks ago
Your Answer

8 + 5 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com