I having a problem on using Split Method()
.
I have a string like this:
string diagnosis = "001.00 00 002.01 00 003.00 01";
And output should be:
001.00
002.01
003.00
I tried in this two ways to remove the two digits:
string[] DiagnosisCodesParts = diagnosis.Split();
if (DiagnosisCodesParts[x].Length > 3)
{
//here
}
And..
string DiagnosisCodestemp = diagnosis.Replace(" 00 ", " ").Replace(" 01 ", " ").Replace(" 02 ", " ")
Is there other way to remove the two digits?
Clearest to me would be
Regex.Matches(diagnosis, @"\d+\.\d+").Cast<Match>().Select(m => m.Value);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With