◽ Java language/Java
[Java - (16) ] 특정값 몇개인지 체크 ( StringUtils 이용 )
kkk20000a
2020. 4. 29. 15:10
1
2
3
4
5
6
7
|
import org.apache.commons.lang.StringUtils;
String txt = "Test, java, Oracle, main";
int countMatches = StringUtils.countMatches(txt, ",");
System.out.println(countMatches);
|