Solved

Spreading string over multiple lines

Posted on 2004-10-13
2
1,079 Views
Last Modified: 2012-06-22
is there a possibility to spread a string over multiple lines like in c++ the \ does?
example:
i wanted to spread long command lines like in c++:
string test = "hi \
                    hi \
                    hi \
                    hi";
thats the same as if i would have
string test = "hi hi hi hi";
i dont want to use the + operator. thats a different thing.
thx
vo1d
0
Comment
Question by:vo1d
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 14

Accepted Solution

by:
AvonWyss earned 125 total points
ID: 12298004
Use literal strings. Note that literal strings do not use escaped chars with \.

string test = @"hi
 hi
 hi
 hi";

This will do what you expect.
0
 
LVL 11

Author Comment

by:vo1d
ID: 12299206
thx very much. thats what i was looking for.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question