开发者

Remove Last element from a Character Array in Android?

开发者 https://www.devze.com 2023-04-11 04:26 出处:网络
What i 开发者_C百科Have:At present i have a String variable i-e: String str_StoreValue; I have appended it with some string values and converted it into a Character Array by doing this:

What i 开发者_C百科Have: At present i have a String variable i-e:

String str_StoreValue;

I have appended it with some string values and converted it into a Character Array by doing this:

char[] ch_TestArray = str_StoreValue.toCharArray();

What i want: i want to remove the last element of this char[] ch_TestArray.

Can somebody help me out. I'm new to android.


This is just easier:

char[] ch_TestArray = str_StoreValue.substring(0, str_StoreValue.length()-1).toCharArray();
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号