팩토리 » Api
stringcharcount
Description
문자열내에 문자 유형에 따른 문자수를 반환한다.
Parameters
Parameters |
Type |
Description |
nCharType |
short |
문자 유형 |
strString |
STRING |
대상 문자열 |
Return Value
Type |
Description |
short |
문자수 또는 오류 발생시 -1 |
Remark
**nCharType 파라미터 값
0: 특수문자
1: 숫자
2: 대문자
3: 소문자
4: 한글
Example
function charCount()
{
var ret;
ret = factory.stringcharcount(0, "@#$ABC");
factory.consoleprint("특수문자 수: " + ret); // 결과값 : 3
ret = factory.stringcharcount(1, "012ABC");
factory.consoleprint("숫자문자 수: " + ret); // 결과값 : 3
ret = factory.stringcharcount(2, "abcABC");
factory.consoleprint("영문대문자 수: " + ret); // 결과값 : 3
ret = factory.stringcharcount(3, "abcABC");
factory.consoleprint("영문소문자 수: " + ret); // 결과값 : 3
ret = factory.stringcharcount(4, "홍길동ABC");
factory.consoleprint("한글문자 수: " + ret); // 결과값 : 3
}
Viewer Ver.
22.11.30.1
Update Date
20221130