Re: Sting with Quotes Issue
Code:
var df = @"C:\temp\test\backups\";
// var df = "\"" + @"C:\temp\test\backups\";
Console.WriteLine(df);
if (df[0] != '\"')
{
df = "\"" + df;
}
Console.WriteLine(df);
That being said, want you probably want to do is form the complete portion of the string that needs to be double quoted and then write a method that checks and quotes the ends as necessary. This ends up being easier to follow than quoting the beginning forming the rest of the string and then quoting the end (plus the method is reusable).