Hidden linebreaks in string? VB.NET

Discussion in 'Software' started by Jiggy, Apr 23, 2008.

  1. Jiggy

    Jiggy

    Joined:
    Apr 23, 2008
    Messages:
    1
    I have the following problem.

    I receive an XML file from one of our customers webservice.
    Within this xml file, I have a section with the following .

    <comment>20-03-2008
    Issue 12345 handled
    Issue 12345 closed

    28-03-2008
    Issue 12345 handled
    Issue 12345 closed
    </comment>

    Now i generate some sort of report, in HTML.

    I read the <comment> tag into a string.
    I use the string in my report, and that’s where the misery starts. The HTML gives an error and can’t show.

    After some testing and debugging, I found out, that the error is likely because of hidden linebreaks in the string. When I look at the string when debugging, it just shows as a normal linear string, no weird chars.
    However when I copy the string and paste it in word for example, it suddenly shows the text with the linebreaks as it was in the xml comment. If for example I copy the string manually while debugging and make a variable, which I then paste the string in, and use this string as the source for the HTML, then it does not give an error (although when comparing the string textually, it is the exact same thing).

    My problem is, that it would be fine for me to either remove the hidden linebreaks, or to alter the string so that it does show in HTML without errors.
    I tried everything I could think of, looked for vbClRf etc but I just can’t find what causes the linebreaks in the first place, let alone how to remove it.
    Other then that I don’t really have any clue atm, since the linebreaks don’t show visually appear in my string.

    Any help appreciated is greatly appreciated.
    Jiggy, Apr 23, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. msandlana
    Replies:
    0
    Views:
    2,408
    msandlana
    Apr 25, 2008
  2. newasp.net
    Replies:
    1
    Views:
    1,599
    imransyed63
    Aug 21, 2008
  3. jerryantony
    Replies:
    0
    Views:
    1,776
    jerryantony
    Nov 4, 2009
  4. priyajee
    Replies:
    2
    Views:
    4,804
    article
    Dec 9, 2009
  5. Boppy
    Replies:
    10
    Views:
    1,146
    Sweetpea
    Jan 23, 2010
Loading...

Share This Page