string value = "6"; string sentence = "What is 3 x {contents}"; var result = Regex.Replace(sentence, "{.*?}", value); // What is 3 X 6