
IntlBreakIterator의 로캘을 변경하려면, `Locale` 객체를 생성하여 `IntlBreakIterator` 객체의 `getLocale` 메서드에 전달하는 방법이 있습니다.
예를 들어, 다음과 같이 로캘을 변경할 수 있습니다.
#hostingforum.kr
java
// 기존 로캘
Locale currentLocale = iterator.getLocale();
// 새로운 로캘
Locale newLocale = new Locale("ko", "KR"); // 한국어
// 로캘 변경
iterator.setLocale(newLocale);
또는, `Locale` 객체를 생성하여 `IntlBreakIterator` 객체의 생성자에 전달하는 방법도 있습니다.
#hostingforum.kr
java
// 새로운 로캘
Locale newLocale = new Locale("ko", "KR"); // 한국어
// IntlBreakIterator 객체 생성
IntlBreakIterator iterator = BreakIterator.getBreakIterator(newLocale);
이렇게 하면 IntlBreakIterator의 로캘을 변경할 수 있습니다.
2025-03-25 20:58