Page 1 of 1

[SNIPPET] Force UPPER CASE for ROMAN NUMERALS

Posted: 12 Jul 2014, 16:18
by rednoah
If you want to force roman numerals to upper-case characters then a simple regex-replace will do the just just fine.

Code: Select all

{n.replaceAll(/\b(?i:I|II|III|IV|V|VI|VII|VIII|IX|X)\b/, { it.upper() })}
\b ... word boundary (i.e. non-character like blank)
?i ... case-insensitive group