setRegion method

void setRegion(
  1. String s
)

Set the region part of the Locale.

See the Rust documentation for try_from_str for more information.

Throws LocaleParseError on failure.

Implementation

void setRegion(String s) {
  final temp = _FinalizedArena();
  final result = _icu4x_Locale_set_region_mv1(_ffi, s._utf8AllocIn(temp.arena));
  if (!result.isOk) {
    throw LocaleParseError.values[result.union.err];
  }
}