C#
2014.05.13 15:06
문자열에서 특정 문자의 갯수 구하는 함수
다물칸 주소복사
조회 수 1724 추천 수 0 댓글 0
구분 | 팁&트릭 |
---|---|
출처 | 내가작성 |
public static int ProcGetStringcount(string strTotal, string strFind) { System.Text.RegularExpressions.Regex cntStr = new System.Text.RegularExpressions.Regex(strFind); return int.Parse(cntStr.Matches(strTotal, 0).Count.ToString()); }