java 字符串去重

package interview;

import java.util.ArrayList;

public class RemoveDuplicates {
	public static void main(String[] args) {
		String s = "aafgdfdaaabaa";
		char[] charArr = s.toCharArray();
		ArrayList list =new ArrayList();
		
		if(s.contains("a"))
			System.out.println("contains a ");
		removeDuplicates(charArr);
		removeDuplicate3(s);
	}

	private static void removeDuplicate3(String s) {
		// TODO Auto-generated method stub
		if(s==null)
			return ;
		if(s.length()<2)
			return ;
		
		char[] charArr = s.toCharArray();
		int p=0;
		int len = s.length();
		for(int i=0;i

你可能感兴趣的:(Java)