I have string in format
"sometext%1%-%2%blablabla%15%"
and collection of class Variable:
public class Variable
{
public long Id { get; set; }
public string Value { get; set; }
}
How can I replace all substrings like "%{ID Number}%" with Value field of Variable which Id equals to {ID Number} (for example replace "%1%" with Variable Value field whose ID = 1) using Regex.Replace method or something similar?