如何确定数组是否包含 Java 中的特定值? - How do I determine whether an array contains a particular value in Java?

问题:

I have a String[] with values like so:我有一个String[]的值如下:

public static final String[] VALUES = new String[] {"AB","BC","CD","AE"};

Given String s , is there a good way of testing whether VALUES contains s ?给定String s ,是否有一种测试VALUES是否包含s的好方法?


解决方案:

参考一: https://en.stackoom.com/question/4jdD参考二: https://stackoom.com/question/4jdD
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章