java小工具(三)随机返回字符串数组中的字符串
//随机返回字符串数组中的字符串
public static String RandomStr(String[] strs){
int random_index = (int) (Math.random()*strs.length);
return strs[random_index];
}
最后
以上就是迷人小鸭子最近收集整理的关于java小工具(三)随机返回字符串数组中的字符串的全部内容,更多相关java小工具(三)随机返回字符串数组中内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复