取得字符串中是否重复字符

private bool isCan(string val)
    {
        bool result = true;
        foreach(char s in val)
        {
            if (new Regex(s.ToString()).Matches(val).Count > 1)
            {
                result = false;
                break;
            }
        }
        return result;
    }
posted @ 2010-08-04 15:06  94cool  阅读(134)  评论(0)    收藏  举报