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

  • Home
  • SEARCH
  • 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 6886913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:49:09+00:00 2026-05-27T05:49:09+00:00

When I try and display text from an the InnerText from an XML element.

  • 0

When I try and display text from an the InnerText from an XML element. I get something like this:

I need this spacing \r\n\r\n\r\second lot of spacing\r\n\r\nMore spacing\r\n\r\n

I know you can replace \r\n with <br> but is there no function that automatically takes the html for you and why does it use \r and \n? Many thanks.

  • 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-27T05:49:09+00:00Added an answer on May 27, 2026 at 5:49 am

    You can use <pre> tag – it will show the text as-is like you see it in text editor:

    For example:

    <pre><%=MyText%></pre>
    

    Better practice for ASP.NET is:

    <pre id="myPlaceholder" runat="server"></pre>
    

    Then assign its value from code behind:

    myPlaceholder.InnerHtml = MyText;
    

    As for your question “why does it use \r and \n” those are carriage return and line feed characters, aka newline characters – when you have such text:

    line 1
    line 2
    

    Then code reading it will give: line1\nline2 or line1\r\nline2 depending on how it’s stored exactly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on app where I need to display arabic text from a
Using monotouch, I'm try to display a core text element over multiple lines. The
I've been using this code to try and get data from the google weather
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
This is a program I'm writing that's supposed to display some text in a
I'd like to display some language specific characters from javascript but I can't. My
I have the following code snippet I'm trying to get the text from: <span
I've got a VB.NET module that reads from a resource file to display text
I try to do binding from DataTemplate to myGridViewColumn. I want to display custom
Currently my GUI is Freezing when I try to display data I read from

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.