public static ParseString ( string input ) : string | ||
input | string | a string containing ${named} variables that represent the translation keys |
return | string |
public static string ParseString(string input)
{
Regex replacements = new Regex(@"\$\{([^\}]+)\}");
MatchCollection matches = replacements.Matches(input);
foreach (Match match in matches)
{
input = input.Replace(match.Value, GetByName(match.Groups[1].Value));
}
return input;
}