Split string based on Roman Numerals C# -
i want find roman numbers inside string (numbers below 20 enough) , split string based on roman numbers
eg:user input :
whats name?i)my name c# ii)my name ror iii)my name java
i want
whats name? i)my name c# ii)my name ror iii)my name java
edit:this format optional questions..so options wont go no more 5 or 6..
this code:
string input = "i. text. ii. text... v. stupid text. xvii. eshe kakaya-to hernya..."; regex r = new regex(@"\bx{0,3}(i{1,3}|i[vx]|vi{0,3})\b", regexoptions.ignorecase); string result = r.replace(input, new matchevaluator(e => environment.newline + e.value)).trim();
result:
i. text. ii. text... v. stupid text. xvii. eshe kakaya-to hernya...
Comments
Post a Comment