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

From: Scatropolis (chronos_at_frayed.net)
Date: 05/09/04


Date: Sun, 9 May 2004 12:13:02 -0700

One idiea that I've had that haven't followed up on is to have an imbedded
text file. Then just read the text file when needed. I know there's a way.
Also if it comes down to it you could right a very basic program that auto
wrote all those "x += " for you. Just two textboxes. Probably not what
you're wanting though.

On 08/05/2004 newsgroup@frenkelfamily.org (Richard Frenkel) wrote:
>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

  • Re: How to assign a block of text to a string in C#
    ... there is no equivalent syntax in C#. ... > This is a bunch of text ... > that is assigned to string x ... Just adding all the quotes is tedious. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to assign a block of text to a string in C#
    ... >> a string. ... >> This is a bunch of text ... Just adding all the quotes is tedious. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Update existing values incrementally w/UPDATE SQL
    ... I think it would be safe to say, use the Dim statement any time you are ... Dim basically tells vba that you want to initiate a new variable. ... As far as quotes go, this was one of the trickiest ... Consider vba's interpretation of a string: ...
    (microsoft.public.access.modulesdaovba)
  • Re: Update existing values incrementally w/UPDATE SQL
    ... and in the book; Access 2007 VBA Programmer's Reference. ... As far as quotes go, this was one of the trickiest ... Consider vba's interpretation of a string: ... when an SQL is processed (I use an SQL example because it is the most ...
    (microsoft.public.access.modulesdaovba)
  • Re: Update existing values incrementally w/UPDATE SQL
    ... pretend that Me.txtString is a control on your form, ... You cant put Me.txtString inside the double quotes, or VBA just reads it as a ... and in the book; Access 2007 VBA Programmer's Reference. ... when an SQL is processed (I use an SQL example because it is the most ...
    (microsoft.public.access.modulesdaovba)