From cdef17b5abaa8f2dbf7f470afed4747bf11e6b0b Mon Sep 17 00:00:00 2001 From: alcexhim Date: Mon, 1 Dec 2014 15:44:25 -0500 Subject: [PATCH] Added comments and made ReplaceVariables(string, Dictionary`2) into an extension method --- .../Libraries/UniversalEditor.Core/Common/Strings.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CSharp/Libraries/UniversalEditor.Core/Common/Strings.cs b/CSharp/Libraries/UniversalEditor.Core/Common/Strings.cs index f4b63534..2a7778f3 100644 --- a/CSharp/Libraries/UniversalEditor.Core/Common/Strings.cs +++ b/CSharp/Libraries/UniversalEditor.Core/Common/Strings.cs @@ -5,7 +5,16 @@ namespace UniversalEditor.Common { public static class Strings { - public static string ReplaceVariables(string value, Dictionary variables) + /// + /// Replaces a collection of named variables in a given string. + /// + /// The string in which to replace variables. + /// A containing name-value pairs of variables to replace. + /// + /// A with all instances of variables with the given name in $(VariableName) replaced + /// with the associated value. + /// + public static string ReplaceVariables(this string value, Dictionary variables) { string retval = value; foreach (string key in variables.Keys)