字符串资源新行/n 不可能? [英] String Resource new line /n not possible?

查看:31
本文介绍了字符串资源新行/n 不可能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎不可能在 XML 资源字符串中添加新行 /n.还有其他方法吗?

It doesn't seem like it's possible to add a new line /n to an XML resource string. Is there another way of doing this?

推荐答案

使用黑斜线而不是正斜线.

use a blackslash not a forwardslash.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="title">Hello
World!</string>
</resources>

此外,如果您打算将字符串用作 HTML,您可以使用 &lt;br/&gt; 作为换行符(<br/>)

Also, if you plan on using the string as HTML, you can use &lt;br /&gt; for a line break(<br />)

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="title">Hello&lt;br /&gt;World!</string>
</resources>

这篇关于字符串资源新行/n 不可能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆