简洁的方法:
public static void main(String[] args) { String[] arr = {"a","b","c","d"}; String stringValue = "d"; System.out.println("arr数组包含stringValue:" + Arrays.asList(arr).contains(stringValue)); }
简洁的方法:
public static void main(String[] args) { String[] arr = {"a","b","c","d"}; String stringValue = "d"; System.out.println("arr数组包含stringValue:" + Arrays.asList(arr).contains(stringValue)); }