# Long string , how to insert a new line?

**URL:** <https://www.ruby-forum.com/t/long-string-how-to-insert-a-new-line/200996>\
**Category:** Rails I18n\
**Created:** [December 27, 2010, 7:20pm UTC](https://www.ruby-forum.com/t/long-string-how-to-insert-a-new-line/200996 "2010-12-27T19:20:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [December 27, 2010, 7:20pm UTC](https://www.ruby-forum.com/t/long-string-how-to-insert-a-new-line/200996/1 "2010-12-27T19:20:01Z")

</div>

I have a very long string I want to split in 2 lines ,

I use \r\n and wrote :

other\_web\_browsers\_warning: “You are welcome to continue using your  
current web browser,\r\n but you may experience display issues or  
other difficulties.”

but this doesn’t split the line … ( tried also the html tag \<br /

> … no way )  
> hope the answer will be a New Year gift …

Happy New Year 2011

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [December 27, 2010, 7:25pm UTC](https://www.ruby-forum.com/t/long-string-how-to-insert-a-new-line/200996/2 "2010-12-27T19:25:01Z")

</div>

[http://www.yaml.org/YAML\_for\_ruby.html](http://www.yaml.org/YAML_for_ruby.html)

other\_web\_browsers\_warning: |-  
You are welcome to continue using your current web browser,  
but you may experience display issues or other difficulties.

Regards,  
KK

2010/12/27 Erwin [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [December 28, 2010, 9:28am UTC](https://www.ruby-forum.com/t/long-string-how-to-insert-a-new-line/200996/3 "2010-12-28T09:28:08Z")

</div>

thanks a lot … will try asap my I18n gem is back working… (just  
added new msg)

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [November 25, 2011, 10:34am UTC](https://www.ruby-forum.com/t/long-string-how-to-insert-a-new-line/200996/4 "2011-11-25T10:34:39Z")

</div>

I can’t find a way to insert a line break in yaml files. I only have  
yaml in one project where \n really makes a new line. No matter how I  
try they never appear. I’ve followed the documentation and tried all  
possible ways but nothing.

There must be a trick, encoding or something, but I can’t see the  
difference between the one that works and the other.

So frustrating!

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [November 25, 2011, 10:42am UTC](https://www.ruby-forum.com/t/long-string-how-to-insert-a-new-line/200996/5 "2011-11-25T10:42:00Z")

</div>

comopasta Gr wrote in post #1033654:

> I can’t find a way to insert a line break in yaml files. I only have  
> yaml in one project where \n really makes a new line. No matter how I  
> try they never appear. I’ve followed the documentation and tried all  
> possible ways but nothing.
> 
> There must be a trick, encoding or something, but I can’t see the  
> difference between the one that works and the other.
> 
> So frustrating!

There is nothing better to progress with something than writing to a  
forum and complain.

I used \n in the yaml. In the view it was not showing the line break.  
Then I check the generated html and actually in the code there was a  
line break. I put the text within a

```
tag and now the view shows the
line break again. I think I’m still missing something but can at least
move from here.
```
