---
title: "判断组是否相等"
author: "cbbs"
date: "2010-09-14T11:52:00Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2010-09-14T11:52:49Z"
id: 762859
url: "https://cbbs.iteye.com/blog/762859"
---

```
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;
}
```