[Solved] How to replace tokens on a string template? [closed]
Short answer I think it would be best to use a Regex. var result = Regex.Replace(str, @”{{(?<Name>[^}]+)}}”, m => { return m.Groups[“Name”].Value; // Date, Time }); On c#-6.0 you can use: string result = $”Time: {DateTime.Now}”; String.Format & IFormattable However, there is a method for that already. Documentation. String.Format(“The current Date is: {0}, the time … Read more