feat: Adding enquote util method

This commit is contained in:
Chris Cameron
2018-06-12 13:31:44 -04:00
parent 1a931e6ffb
commit f7b5d07c38
2 changed files with 27 additions and 0 deletions

View File

@@ -688,5 +688,24 @@ namespace ICD.Common.Utils
return output;
}
/// <summary>
/// Ensures the value starts and ends with a double quote.
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static string Enquote(string value)
{
if (value == null)
throw new ArgumentNullException("value");
if (!value.StartsWith('"'))
value = '"' + value;
if (!value.EndsWith('"'))
value += '"';
return value;
}
}
}