
IntlChar::isblank 함수는 공백 문자를 인식하는 데 사용되는 함수로, 공백 문자인 '\ ' (스페이스), '\t' (탭), '\n' (라인 피드), '\v' (파일 피드), '\f' (폼 피드), '\r' (캐리지 리턴) 등을 인식합니다.
IntlChar::isblank 함수의 인자로 들어가는 문자가 공백 문자인지 아닌지를 알려면, 함수를 호출하여 반환 값을 확인하면 됩니다.
IntlChar::isblank 함수를 사용하여 특정 문자가 공백 문자인지 아닌지를 확인하는 예제는 다음과 같습니다.
#hostingforum.kr
cpp
#include
#include
int main() {
icu::UnicodeString str;
str.append(" ");
std::cout << std::boolalpha << IntlChar::isblank(str.charAt(0)) << std::endl; // true
str.clear();
str.append("t");
std::cout << std::boolalpha << IntlChar::isblank(str.charAt(0)) << std::endl; // true
str.clear();
str.append("n");
std::cout << std::boolalpha << IntlChar::isblank(str.charAt(0)) << std::endl; // true
str.clear();
str.append("a");
std::cout << std::boolalpha << IntlChar::isblank(str.charAt(0)) << std::endl; // false
return 0;
}
IntlChar::isblank 함수의 반환 값은 bool 타입으로, true이면 공백 문자이고, false이면 공백 문자가 아닙니다.
2025-07-07 13:41