日期:2014-05-18 浏览次数:20877 次
public int MatchCharCount(string data, string match) { int returnValue = 0; char[] dataCharArray = data.ToCharArray(); char[] matchCharArray = match.ToCharArray(); for (int i = 0; i < matchCharArray.Length; i++) { for (int j = 0; j < dataCharArray.Length; j++) { if (matchCharArray[i] == dataCharArray[j]) { returnValue++; break; } } } return returnValue; }