Код: Выделить всё
public static string ToTitleCaseWithRoman(this string value)
{
var text = value.ToLower();
text = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(text);
var roman = new Regex(@"\b(I|II|III|IV|V|VI|VII|VIII|IX|X)\b", RegexOptions.IgnoreCase);
text = roman.Replace(text, x => x.Value.ToUpper());
return text;
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... njunctions
Мобильная версия