其他分享
首页 > 其他分享> > 关于转义字符的处理

关于转义字符的处理

作者:互联网

在Unity脚本中可以直接使用带有“\n”转义字符(escape character)的字符串,使得字符串能够在GUI中显示换行。

如果配置或服务器发送的字符串里面包含转义字符“\\n”,我们需要将“\\n”处理一下替换为“\n”。

System.Text.RegularExpressions.Regex.Unescape(text);

 

参考:https://answers.unity.com/questions/138464/how-to-make-a-line-break-in-a-gui-label.html

参考:https://blog.csdn.net/YouyoMei/article/details/88715593

标签:Regex,参考,处理,转义字符,关于,https,字符串,服务器发送
来源: https://www.cnblogs.com/TravelingLight/p/16121144.html