Getting linefeeds from multiline text in c# - InfoPath Dev
in

InfoPath Dev

Getting linefeeds from multiline text in c#

Last post 12-17-2009 01:37 AM by chris leate. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-10-2009 07:25 AM

    Getting linefeeds from multiline text in c#

    Hi all,
    I may get put on the naughty step for asking this here but I've been writing a bit of code which builds a word document from an infopath quote system which the previous developer wrote. I have managed to get most of this working using the word  application object. Unfortunately I can't seem to be able to find the line feeds with a replace.

    I've tried address String.Replace(Convert.ToChar(13).ToString(), "test"); String.Replace("\r\n", "test"); String.Replace(System.Environment.NewLine, "test");ETC. None of which are working.

    Any ideas?

     

  • 12-16-2009 05:18 AM In reply to

    Re: Getting linefeeds from multiline text in c#

    Have you tried String.Replace("\n", "test");?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-16-2009 10:31 PM In reply to

    Re: Getting linefeeds from multiline text in c#

    try

    String.Replace( "\r\n", replacement )
                     
    .Replace( "\r", replacement )
                     
    .Replace( "\n", replacement );
       

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 12-17-2009 01:37 AM In reply to

    Re: Getting linefeeds from multiline text in c#

    Cheers Qazi. That was what I ended up using in the end. There are still some encoding characters there but I guess it's all just trial and error from here. I bet they're tabs or something.

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.