一次循环查找字符串中第一个不重复的字节

来源:互联网 发布:js array 添加数据 编辑:程序博客网 时间:2024/06/16 09:14
public static char getChar(String text){       char c =0xff;       for(int index =0;index <text.length();index ++){            c =text.charAt(index);            if(text.indexOf(c) ==text.lastIndexOf(c)) break;       }       return c;   } 
0 0