Home All Groups Group Topic Archive Search About
Author
12 Jan 2006 8:34 PM
Diffident
Hello All,

I have a string of around 150 characters.

string test = "asjhdkashdkjahsdjkhaskjdhaskjdhasjdhasd........."; //(upto
150 characters)

I want to split the above string into multiple lines in IDE while declaring
it so that it is more readable. How can I do that?

I do not want to concatenate using "+" nor do I want to use stringbuilder
object. I tried using @. If I use @ followed by the string, compiler is
inserting special characters like \t,\n. I think that I can StringBuilder
object but are there any other alternatives?

My goal is to be able to declare string like this without using "+" or
stringbuilder spread accross in multiple lines in IDE.

string test = "asjhdajkshdjkashdajksdhajskdhasd
                       sdfsjkdhfkjsdhfsjkdhfskjdfhskdjfhsd
                       sdfhsdjkfhsjdkfhsdjkfhsdjkfhsdkjfhs";

I hope I made sense as to what I want to achieve....

Thank you.

Author
12 Jan 2006 9:02 PM
S. Justin Gengo [MCP]
Diffident,

How about turning on word wrapping in the IDE?

Tools - Options

Language node of your choice: Check the "Word wrap" check box.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
                            Nietzsche
Show quoteHide quote
"Diffident" <Diffid***@discussions.microsoft.com> wrote in message
news:D2B9A188-596C-4B5F-80AA-FA8D6A7E08A1@microsoft.com...
> Hello All,
>
> I have a string of around 150 characters.
>
> string test = "asjhdkashdkjahsdjkhaskjdhaskjdhasjdhasd........."; //(upto
> 150 characters)
>
> I want to split the above string into multiple lines in IDE while
> declaring
> it so that it is more readable. How can I do that?
>
> I do not want to concatenate using "+" nor do I want to use stringbuilder
> object. I tried using @. If I use @ followed by the string, compiler is
> inserting special characters like \t,\n. I think that I can StringBuilder
> object but are there any other alternatives?
>
> My goal is to be able to declare string like this without using "+" or
> stringbuilder spread accross in multiple lines in IDE.
>
> string test = "asjhdajkshdjkashdajksdhajskdhasd
>                       sdfsjkdhfkjsdhfsjkdhfskjdfhskdjfhsd
>                       sdfhsdjkfhsjdkfhsdjkfhsdjkfhsdkjfhs";
>
> I hope I made sense as to what I want to achieve....
>
> Thank you.
Are all your drivers up to date? click for free checkup

Author
12 Jan 2006 9:17 PM
Diffident
Works great!!

Did not know that I could use word wrap.....

Show quoteHide quote
"S. Justin Gengo [MCP]" wrote:

> Diffident,
>
> How about turning on word wrapping in the IDE?
>
> Tools - Options
>
> Language node of your choice: Check the "Word wrap" check box.
>
> --
> Sincerely,
>
> S. Justin Gengo, MCP
> Web Developer / Programmer
>
> www.aboutfortunate.com
>
> "Out of chaos comes order."
>                             Nietzsche
> "Diffident" <Diffid***@discussions.microsoft.com> wrote in message
> news:D2B9A188-596C-4B5F-80AA-FA8D6A7E08A1@microsoft.com...
> > Hello All,
> >
> > I have a string of around 150 characters.
> >
> > string test = "asjhdkashdkjahsdjkhaskjdhaskjdhasjdhasd........."; //(upto
> > 150 characters)
> >
> > I want to split the above string into multiple lines in IDE while
> > declaring
> > it so that it is more readable. How can I do that?
> >
> > I do not want to concatenate using "+" nor do I want to use stringbuilder
> > object. I tried using @. If I use @ followed by the string, compiler is
> > inserting special characters like \t,\n. I think that I can StringBuilder
> > object but are there any other alternatives?
> >
> > My goal is to be able to declare string like this without using "+" or
> > stringbuilder spread accross in multiple lines in IDE.
> >
> > string test = "asjhdajkshdjkashdajksdhajskdhasd
> >                       sdfsjkdhfkjsdhfsjkdhfskjdfhskdjfhsd
> >                       sdfhsdjkfhsjdkfhsdjkfhsdjkfhsdkjfhs";
> >
> > I hope I made sense as to what I want to achieve....
> >
> > Thank you.
>
>
>
Author
12 Jan 2006 9:07 PM
Bruce Barker
use the "+" for readability, as the compiler will optimize it out.

-- bruce (sqlwork.com)



Show quoteHide quote
"Diffident" <Diffid***@discussions.microsoft.com> wrote in message
news:D2B9A188-596C-4B5F-80AA-FA8D6A7E08A1@microsoft.com...
> Hello All,
>
> I have a string of around 150 characters.
>
> string test = "asjhdkashdkjahsdjkhaskjdhaskjdhasjdhasd........."; //(upto
> 150 characters)
>
> I want to split the above string into multiple lines in IDE while
> declaring
> it so that it is more readable. How can I do that?
>
> I do not want to concatenate using "+" nor do I want to use stringbuilder
> object. I tried using @. If I use @ followed by the string, compiler is
> inserting special characters like \t,\n. I think that I can StringBuilder
> object but are there any other alternatives?
>
> My goal is to be able to declare string like this without using "+" or
> stringbuilder spread accross in multiple lines in IDE.
>
> string test = "asjhdajkshdjkashdajksdhajskdhasd
>                       sdfsjkdhfkjsdhfsjkdhfskjdfhskdjfhsd
>                       sdfhsdjkfhsjdkfhsdjkfhsdjkfhsdkjfhs";
>
> I hope I made sense as to what I want to achieve....
>
> Thank you.
Author
12 Jan 2006 9:21 PM
Diffident
Bruce,

Can you please explain me how compiler would be able to optimize "+".

Why I did not want to use string concatenation was that I wanted it to be a
single string object and hence less memory would be used. But if I use "+"
does not that consume more memory due to string's inherent property of
immutability and hence heavy cost of concatenations?

Please correct me if I am wrong...

Show quoteHide quote
"Bruce Barker" wrote:

> use the "+" for readability, as the compiler will optimize it out.
>
> -- bruce (sqlwork.com)
>
>
>
> "Diffident" <Diffid***@discussions.microsoft.com> wrote in message
> news:D2B9A188-596C-4B5F-80AA-FA8D6A7E08A1@microsoft.com...
> > Hello All,
> >
> > I have a string of around 150 characters.
> >
> > string test = "asjhdkashdkjahsdjkhaskjdhaskjdhasjdhasd........."; //(upto
> > 150 characters)
> >
> > I want to split the above string into multiple lines in IDE while
> > declaring
> > it so that it is more readable. How can I do that?
> >
> > I do not want to concatenate using "+" nor do I want to use stringbuilder
> > object. I tried using @. If I use @ followed by the string, compiler is
> > inserting special characters like \t,\n. I think that I can StringBuilder
> > object but are there any other alternatives?
> >
> > My goal is to be able to declare string like this without using "+" or
> > stringbuilder spread accross in multiple lines in IDE.
> >
> > string test = "asjhdajkshdjkashdajksdhajskdhasd
> >                       sdfsjkdhfkjsdhfsjkdhfskjdfhskdjfhsd
> >                       sdfhsdjkfhsjdkfhsdjkfhsdjkfhsdkjfhs";
> >
> > I hope I made sense as to what I want to achieve....
> >
> > Thank you.
>
>
>

Bookmark and Share