标签:
1. public class Simple{ 2. public static char getChar(String text){ 3. char c =0xff; 4. for(int index =0;index <text.length();index ++){ 5. c =text.charAt(index); 6. if(text.indexOf(c) ==text.lastIndexOf(c)) break; 7. } 8. return c; 9. } 10. 11. public static void main(String[] args){ 12. System.out.println(getChar("teeter")); 13. System.out.println(getChar("teeterh")); 14. } 15. } |
标签:
原文地址:http://www.cnblogs.com/hkzws/p/4889549.html