what is the best and optimise wayto extract substrings from a specified string.
my primary string is like
string str = \"ACK
string str = @"<ABCMSG><t>ACK</t><t>AAA0</t><t>BBBB1</t></ABCMSG>";
var matches = Regex.Matches(str, @"<t>(\w+)<\/t>");
Console.WriteLine(matches[1].Groups[1]); // outputs "AAAA1"
Console.WriteLine(matches[2].Groups[1]); // outputs "BBB2"
This assumes that your data are always inside a <t></t>
tag, also you might want to do some error catching in case no matches are found.