Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3331400
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:34:50+00:00 2026-05-17T23:34:50+00:00

I need to put an adress into a appointment. The address is constructed out

  • 0

I need to put an adress into a appointment. The address is constructed out of several variables. Of course I also need some newlines. But “\n” doesnt result in an new line when i open the appointment in outlook.

Ok here is code snippet:

    string address = name + "\n" + strasse + "\n" + plz.ToString() + " " + ort;
        if ( telefon != "") {
            address = address + "\nTelefon:: " + telefon;
        }
        if ( natel != "") {
            address = address + "\nNatel: " + natel;
        }
        if ( mail != "") {
            address = address + "\nE-Mail: " +mail;
        }

Nothing special. The Problem is when i write this to the body of an appointment, then there aren’t any actual newlines.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:34:50+00:00Added an answer on May 17, 2026 at 11:34 pm

    Its pretty hard to diagnose this without seeing at least an example of the string you are passing, but one thing that I tend to do in my C# code is to use the constant:

    Environment.NewLine
    

    Or I use the StringBuilder class with the AppendLine() call to add a newline.

    Edit: Based on your code snippet, I would write it this way (it will be more performant as well). With your snippet, lots of strings are being allocated (because strings are immutable). The recommended approach in this case is to use StringBuilder.

    StringBuilder address = new StringBuilder();
    address.AppendLine(name);
    address.AppendLine(strasse);
    address.Append(plz.ToString()); // This may not be neccessary depending on the type of plz, StringBuilder has overloads that will convert base types to string for you
    address.Append(" ");
    address.Append(ort);
    if (!string.IsNullOrEmpty(telefon))
    {
         address.AppendLine();
         address.Append("Telefon:: ");
         address.Append(telefon);
    }
    if (!string.IsNullOfEmpty(natel))
    {
         address.AppendLine();
         address.Append("Natel: ");
         address.Append(natel);
    }
    if (!string.IsNullOrEmpty(mail))
    {
         address.AppendLine();
         address.Append("E-Mail: ");
         address.Append(mail);
    }
    
    return address.ToString();
    

    Note: If you are using .Net 4.0 you can use string.IsNullOrWhitespace instead of IsNullOrEmpty to check for not just an empty string, but one that contains only whitespace.

    Edit 2 – Based on your answer of needing <br /> tags instead of newlines.

    const string newLine = " <br /> ";
    StringBuilder address = new StringBuilder();
    address.Append(name);
    address.Append(newLine);
    address.Append(strasse);
    address.Append(newLine);
    address.Append(plz.ToString()); // This may not be neccessary depending on the type of plz, StringBuilder has overloads that will convert base types to string for you
    address.Append(" ");
    address.Append(ort);
    if (!string.IsNullOrEmpty(telefon))
    {
         address.Append(newLine);
         address.Append("Telefon:: ");
         address.Append(telefon);
    }
    if (!string.IsNullOfEmpty(natel))
    {
         address.Append(newLine);
         address.Append("Natel: ");
         address.Append(natel);
    }
    if (!string.IsNullOrEmpty(mail))
    {
         address.Append(newLine);
         address.Append("E-Mail: ");
         address.Append(mail);
    }
    
    return address.ToString();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to put several folders into artifact archive. Now I am doing it
I need to pull RAM information from several cpuz reports and put them into
I need to put a dynamic variable into an address on a form in
I need to put one of my test cases into a pending state. I
I need to put some links in one TextView . For better user experience,
I need to put 2 textures on the same Square, but it keeps crashing
I need to put a custom hover menu from http://www.addthis.com/help/toolbox , but Rails uses
I've been doing history tables for some time now in databases, but never put
MYSQL Database: I have a table of data that I need to put into
I need to put Shipping address , Shipping postcode , Billing Address and Billing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.