csv - How to write quoted strings to files in C#? -



csv - How to write quoted strings to files in C#? -

this question has reply here:

writing string contains “ ” 6 answers

i making new .csv file in c# using streamwriter , writing file writeline("stuff write") method. problem cannot seem write quoted strings, i.e. writeline(" "dog" ") "dog" quoted. tried using double quote method: writeline(@"""dog""") still didn't work (just wrote dog in csv file). how can write quoted strings files?

i'm assuming you're opening in excel, why you're not seeing quotes - excel tries smart when open csv files, it's taking out quotes, though there in raw file.

open result file in text editor, , you'll see quotes when writeline(@"""dog""") approach (or more mutual writeline("\"dog\"")).

c# csv

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -