如何在这种类型的字符串检测新线 [英] how to detect new line in this type of string

查看:152
本文介绍了如何在这种类型的字符串检测新线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

String quote = "Now is the time for all good "+
               "men to come to the aid of their country.";

我要检测破线运行时,当我在点击链接,我想知道新的生产线来..
因为在TextView中我想输出相同这样的字符串没有什么变化..所以告诉我这一些概念或逻辑或源$ C ​​$ C ....

I want to detect break line in run time when I click on button I want to know new line comes.. because in TEXTVIEW i want output same as like this String nothing change.. so tell me some idea or logic or source code of this....

推荐答案

在'\\ n字符指定一个换行符。

The '\n' character specifies a line break.

"Now is the time for all good\nmen to come to the aid of their country."

如果您的GUI是这一点,你需要以某种方式禁用自动换行打破了之前的行。

If your GUI is breaking the line before this point you need to disable word wrapping somehow.

这篇关于如何在这种类型的字符串检测新线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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