This is a migrated thread and some comments may be shown as answers.

Multiline Textbox - Replace line breaks

2 Answers 149 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
Nicklas
Top achievements
Rank 1
Nicklas asked on 06 Mar 2019, 09:11 PM

Hello, I'm currently integrating an API into my application. This API sends out emails, but linebreaks needs to be in \n format. Now, my question is how do I replace the regular (I suppose enviroment.newline) with \n. I tried to do a txtMailMessage.Text.Replace(.....) but it does not work. 

 

Thanks in advance

2 Answers, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 11 Mar 2019, 07:31 AM
Hello, Nicklas,    

According to the provided information, it seems to be more like a general programming question. After some research, I have found the following StackOverflow and MSDN threads which offers different options for replacing the new line:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/b5711945-5d1d-4cac-86c3-58eff30020d4/will-it-be-safe-to-replace-all-newline-character-n-rn-with-environmentnewline-in-a-big?forum=csharpgeneral
https://stackoverflow.com/questions/1751371/how-to-use-n-in-a-textbox
https://stackoverflow.com/questions/9968954/newline-not-showing-correctly-in-textbox/9969009

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Nicklas
Top achievements
Rank 1
answered on 11 Mar 2019, 05:29 PM
Yes I figured this out myself... Abit embarrassing, that I actually forgot to replace \\n instead of \n. Thanks!
Tags
TextBox
Asked by
Nicklas
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Nicklas
Top achievements
Rank 1
Share this question
or