【发布时间】:2011-12-24 14:31:04
【问题描述】:
可能重复:
How would you count occurences of a string within a string (C#)?
我想检查一个字符串是否包含两个东西..
String hello = "hellohelloaklsdhas";
if hello.Contains(*hello 2 Times*); -> True
我该如何解决这个问题?
【问题讨论】:
-
你想要 2 个,还是至少 2 个?