C#: Get text between two strings

Posted by Unknown On Friday, July 10, 2015 0 comments
String between two Strings

string input = "Exemple of value between two string FirstString text I want to keep SecondString end of my string";
var match = Regex.Match(input, @"FirstString (.+?) SecondString ").Groups[1].Value;
All Number between two Strings

string input = "Exemple of value between two string FirstString 1234 I want to keep SecondString end of my string";
var match = Regex.Match(input, @"FirstString (\d*) SecondString ").Groups[1].Value;

0 comments:

Post a Comment