2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > android 小写字母转大写 android将输入到输入框的小写字母自动转换为大写

android 小写字母转大写 android将输入到输入框的小写字母自动转换为大写

时间:2023-02-07 09:53:24

相关推荐

android 小写字母转大写 android将输入到输入框的小写字母自动转换为大写

将输入到输入框的小写字母自动转换为大写

//车牌号码

carNumInfomationTextView = (AutoCompleteTextView) findViewById(R.id.carNumInfomationText);

carNumInfomationTextView.addTextChangedListener( new TextWatcher()

{

@Override

publicvoid onTextChanged( CharSequence s, int start, int before, int count )

{

}

@Override

publicvoid beforeTextChanged( CharSequence s, int start, int count, int after )

{

}

@Override

publicvoid afterTextChanged( final Editable editable ) {

try{

final String temp=editable.toString();

String tem = temp.substring(temp.length()-1, temp.length());

char[] temC = tem.toCharArray();

int mid = temC[0];

if(mid>=97&&mid<=122){//小写字母

new Handler().postDelayed(new Runnable() { @SuppressLint( "DefaultLocale" ) @Override

publicvoid run() {

//小写转大写

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。