[SNIPPET] Force UPPER CASE for ROMAN NUMERALS
Posted: 12 Jul 2014, 16:18
If you want to force roman numerals to upper-case characters then a simple regex-replace will do the just just fine.
\b ... word boundary (i.e. non-character like blank)
?i ... case-insensitive group
Code: Select all
{n.replaceAll(/\b(?i:I|II|III|IV|V|VI|VII|VIII|IX|X)\b/, { it.upper() })}
?i ... case-insensitive group