Results 1 to 3 of 3

Thread: Strange String Problem!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2000
    Location
    Denver
    Posts
    265

    Strange String Problem!

    I'm in the process of updating some old code (which currently works fine), but I've run into a problem. The code uses a StringBuilder to append a series of string to build a SQL statement. One of the values comes from a textbox. I'm now required to use a RichTextBox, and I need to preserve the formatting. I've been trying to use the StringBuilder to append the RichTextBox's .rtf property to the string.

    The StringBuilder works fine, and will append the .rtf, but after I append the .rtf I cannot append any more text.

    i.e.

    obj.Append("string1");
    obj.Append("string2");
    obj.Append(richtext.rtf);
    obj.Append("string3");
    obj.Append("string4");

    In this example strings 3 and 4 will not append because they are after the .rtf string.

    Does anyone have ANY idea why this is happening? Does it have anything to do with the fact that the .rtf property has a carriage return in it? If so, how can I remove the carraige return?

    Thanks in advance for your help!

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    The carriage return I think is represented by \r\n usually. I haven't messed around with the rtf property myself, just thought maybe you would like that info so you could play around some more.

  3. #3
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    it's a problem when using rtf / normal text , null characters get attached to the end of the rtf , preventing anymore text from appearing , replacing the nulls should work.
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width