Link to home
Start Free TrialLog in
Avatar of dylanone
dylanone

asked on

Formatting newlines using ENCODING=QUOTED-PRINTABLE

In the following C# code - I'm writing to a vCalendar the following information the below line works fine however the street, city, state and zip all appear on the same line.

Response.Write("DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" + strDescription + strStreet + strCity + strState + strPostalCode + "\n");

How can I create this so each item is on a seperate line - when I wrote this line like the following:

Response.Write("DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" + strDescription + "\n" + strStreet + "\n" + strCity + "\n" + strState + "\n" + strPostalCode + "\n");

I don't get any compile errors but when I click the link to add the item to my calendar - I get a cannot import vCalendar error then it says:
This error can appear if you have attempted to save a recurring Lunar appointment in iCalendar format.
To avoid this error, set the appointment option to Gregorian instead of Lunar.

Avatar of mrichmon
mrichmon

Try Environment.NewLine instead of "\n"

Response.Write("DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" + strDescription +Environment.NewLine + strStreet + Environment.NewLine + strCity + Environment.NewLine + strState + Environment.NewLine + strPostalCode + Environment.NewLine);
Avatar of dylanone

ASKER

It doesn't appear to like that one either

I still get the error

Actually - I just figured this one out in the vCalendar one can use the "=0A" which works for me!
I guess this question can be deleted or kept for reference!
Please post in community support to have this question closed:
https://www.experts-exchange.com/Community_Support/

ASKER CERTIFIED SOLUTION
Avatar of ee_ai_construct
ee_ai_construct
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial