Search code examples
c#directoryepplus

C# String EPPLUS


I cant seem to get the file to save in the folder with a "," in it.

string myDir = @"S:\\Shared\\SFD\\SFD Analysis\\2016-12-30, Collab Care\\";

...xls.Save();

Any thoughts. I used a literal string, which fixed the spaces, but I would like to reference Windows Filenames with "," in them? Thanks


Solution

  • You're using the verbatim string literal operator @ and escaping the path delimiter

    string myDir = @"S:\\Shared\\SFD\\SFD Analysis\\2016-12-30, Collab Care\\";
    

    Try either

    string myDir = @"S:\Shared\SFD\SFD Analysis\2016-12-30, Collab Care\";
    

    or

    string myDir = "S:\\Shared\\SFD\\SFD Analysis\\2016-12-30, Collab Care\\";