Re: How to assign a block of text to a string in C#

From: clintonG (csgallagher_at_REMOVETHISTEXT@metromilwaukee.com)
Date: 05/09/04


Date: Sat, 8 May 2004 22:41:38 -0500

The StringBuilder Class [1] is the only practical class offering the
functionality you need to achieve the objective.

-- 
<%= Clinton Gallagher
         A/E/C Consulting, Web Design, e-Commerce Software Development
         Wauwatosa, Milwaukee County, Wisconsin USA
         NET csgallagher@REMOVETHISTEXTmetromilwaukee.com
         URL http://www.metromilwaukee.com/clintongallagher/
[1]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemtextstringbuilderclasstopic.asp
"Richard Frenkel" <newsgroup@frenkelfamily.org> wrote in message
news:7e94523.0405081001.7392cceb@posting.google.com...
> I'd like to embed a bunch of text in a c# source file and assign it to
> a string.
> something like:
>
> ----------------------------
> string x = <<eof
>
> This is a bunch of text
> that is assigned to string x
> until the "eof" on a line
> by itself is encountered.
>
> eof
> -------------------------------
>
> of course anyone using Perl will recongize this very convenient
> syntax. Otherwise one has to go thru:
>
> x = 'blah blah';
> x += 'more blah blah";
> etc which is tedious. Just adding all the quotes is tedious. And if
> there are quotes in the text block it's even MORE tedious, and tedium
> is something I don't care for as a programer. So is there a way to do
> this in the C# compiler?


Relevant Pages

  • How to assign a block of text to a string in C#
    ... string x = <<eof ... This is a bunch of text ... until the "eof" on a line ... x += 'more blah blah"; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: newbe: documentation string length
    ... >> You are missing the fact that DEFUN et al. expect a string literal as ... >> documentation, not an expression to be evaluated. ... "blah blah blah" ...
    (comp.lang.lisp)
  • Re: Parameter description
    ... info will show up in the Object Browser as well. ... Public Sub testing(ByVal x As String, ... blah blah blah ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Another form of SQL injection
    ... It allows query parameters to be binded and ... $name = "tom' UNION blah blah blah" ... another form of SQL injection might in the form of... ... is as a string ... ...
    (comp.lang.php)
  • Re: substitution
    ... shows a string that you want to change, how you want to change it, and ... blah blah blah ... > my goal is in loadPage to doesn't show $ERROR message error ...
    (comp.lang.perl.misc)

Loading