Android多行textview - 特定行的字符数?
我正在尝试获取多行文本视图的特定行的字符数。根据其他帖子,我已经得到了相关文本视图的布局。我看到有几个方法传入 (int line),但没有一个方法返回特定行的字符计数?我只是想念它吗?任何帮助将不胜感激。
I'm trying to get the character count of a particular line of a multi-line textview. Based on other posts, I've gotten the Layout of the textview in question. I see several methods that pass in an (int line), but none that return a character count of a particular line? Am I just missing it? Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这将按行分割文本视图中的文本。
This will split the text in the textview by lines.
如果您只是想获取字符串的计数,您是否尝试过 String.length(myString) 返回字符串中有多少个字符的计数?
if your just trying to get the count of a string, have you tried String.length(myString) to return a count of how many characters are in the string?