`
cbbs
  • 浏览: 38908 次
  • 来自: ...
文章分类
社区版块
存档分类
最新评论

判断组是否相等

阅读更多
public boolean compare(String string[]) {
	String[] header = {"a","b","c"};
	if(string.length != header.length) {
		return false;
	}
	for (int i = 0; i < string.length; i++) {
		if ((string[i].trim().replaceAll(" ","").equals(header[i].trim().replaceAll(" ",""))) != true) { 
			return false;
		}
	}
	return true;
}

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics