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 5973555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:48:59+00:00 2026-05-22T20:48:59+00:00

I am wondering how can you do multi line strings without the concat sign(+)

  • 0

I am wondering how can you do multi line strings without the concat sign(+)

I tried this

 string a = String.Format(@"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
                                            {0}xxxxxxx", "GGG");

            string b = @"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
                                            xxxxxxx";


            string c = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
                                            + "xxxxxxx";
           Console.WriteLine(a);
           Console.WriteLine(b);
           Console.WriteLine(c);

This works but the first 2 render alot of whitespace. Is there away to write multi lines without the concat sign and ignore end whitespace without using something like replace after the string is rendered?

Edit

using System; using
System.Collections.Generic; using
System.Linq; using System.Text;

namespace ConsoleApplication2 {
    public class Test
    {

        public Test()
        {
        }

        public void MyMethod()
        {
            string someLongString = "On top of an eager overhead weds a
pressed vat.  How does a chance cage
the contract? The glance surprises the
radical wild.";
        }

} }

Look how it goes right though my formating of the braces and is sticking out(sorry kinda hard to show on stack but it is sticking way to far out).

Sad thing is notepad++ does a better job and when it wraps it goes right under the variable.

  • 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-22T20:49:00+00:00Added an answer on May 22, 2026 at 8:49 pm

    There’s no form of string literal which allows multi-line strings but trims whitespace at the start of each line, no.

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

Sidebar

Related Questions

I am wondering about GAE possibilities and multi-client support; so the question is can
I was wondering how can I set a timeout on a socket_read call? The
I'm wondering how can I submit a form via Ajax (using prototype framework) and
I was wondering how can I list the user tables name with its primary
I am wondering how can I hide/remove a tag after a certain amount of
I'm wondering how can I put a header into my PDF file, cause I've
I was wondering how can I validate a single checkbox using PHP and MySQL.
I was wondering how can I allow NULL values in the following code below
I was wondering how can I programmatically copy all the discussion items from one
I'm new to JQuery and was wondering how can I have Changes saved! displayed

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.