gpt4 book ai didi

android - Android中如何获取TextView的首字母?

转载 作者:行者123 更新时间:2023-11-29 14:19:50 24 4
gpt4 key购买 nike

我没有找到关于如何在 TextView 中获取值的第一个字母的文档?

最佳答案

很简单,

String strTextview = textView.getText().toString();
strTextView = strTextView.substring(0,1);

或者你也可以试试下面的方法

char firstCharacter = textView.getText().toString().charAt(0);

关于android - Android中如何获取TextView的首字母?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22762728/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com