Hi, here is straightforward solution for you:
string input = "School name is {SchoolName} and school contact number is {SchoolPhone} and email is {SchoolEmail}";
string[] output = Regex.Matches(input, "{[^{}]*}")
.OfType<Match>()
.Select(match => match.Value)
.ToArray();
The
Regex
pattern that I used will match everything that begins with '{' and ends with '}' and does not contain those two characters inside of it.