Quote
Add double quotes to the beginning and end of a string. Not taking into account if there are already quotes available.
Source
public static string Quote(this string s)
{
StringBuilder sb = new StringBuilder();
sb.Append('"').Append(s).Append('"');
return sb.ToString();
}
Example
string s = "Hello world";
Console.WriteLine(s.Quote()); // Output: "Hello world"