在的indexOf一个字符串数组 [英] indexOf in a string array
本文介绍了在的indexOf一个字符串数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
反正是有得到的indexOf就像你在一个字符串得到。
Is there anyway to get indexOf like you would get in a string.
output.add("1 2 3 4 5 6 7 8 9 10);
String bigger[] = output.get(i).split(" ");
int biggerWher = bigger.indexOf("10");
我写这篇code,但它返回一个错误,而不是编译!任何建议 ?
I wrote this code but its returning an error and not compiling! Any advice ?
推荐答案
使用此...
output.add("1 2 3 4 5 6 7 8 9 10");
String bigger[] = output.get(i).split(" ");
int biggerWher = Arrays.asList(bigger).indexOf("3");
这篇关于在的indexOf一个字符串数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文