[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Spreading string over multiple lines

Posted on 2004-10-13
2
Medium Priority
?
1,099 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
2 Comments
 
LVL 14

Accepted Solution

by:
AvonWyss earned 500 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month20 days, 12 hours left to enroll

864 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