我怎样才能得到的EditText第10位,并在一个TextView设置这个数字? [英] How can I get the first 10 digits from EditText, and set this digits in a TextView?

查看:140
本文介绍了我怎样才能得到的EditText第10位,并在一个TextView设置这个数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我充满了一个EditText控制领域,它的数字: 475759403048575663648495004945757590
结果我可以使用哪些可供选择这个的EditText第10号:
结果,然后插入数 4757594030 ,在TextView的?

I have a field filled with an EditText control, it figures: 475759403048575663648495004945757590.
What can I use to choose the first 10 numbers from this EditText:
and then, insert the numbers 4757594030, in the TextView?

推荐答案

您可以将字符串的子串为10个字符。

You can substring the string to 10 characters.

String s = somestring.substring(0,10);

因此​​,这将返回前10个字符,现在你可以把值S在你的控制!

So this will return the first 10 characters, and now you can put the value S in your control!

这篇关于我怎样才能得到的EditText第10位,并在一个TextView设置这个数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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