double yuwen=Double.parseDouble(et1.getText().toString().trim());
Double类中本来就有个方法parseDouble() ,作用是把字符串转换为Double。
比如你要把字符串转换为整数也是一样的方法:int a=Integer.parseInt("");
android强转数据类型
猜你喜欢
转载自blog.csdn.net/weixin_44931166/article/details/96765686
今日推荐
周排行