I have not heard of such built-in functions, but you could try this (I assume that your line contains standard format parameters starting with a digit):
List<string> result = new List<string>();
string input = "{0} test {0} test2 {1} test3 {2:####}";
MatchCollection matches = Regex.Matches(input, @"\{\d+[^\{\}]*\}");
foreach (Match match in matches)
{
result.Add(match.Value);
}
it returns the values {0} {0} {1} {2:####}in the list. For tehMick, the result will be empty.
source
share