Roberto Salemi

Roberto Salemi

  • NA
  • 146
  • 141.3k

[C#] Split a string and generating a DataTable

Mar 17 2015 4:45 AM
Good Morning,
I have to run the split of a string and this generate a Datatable.


The string in my possession is of the type:
'B1M3T2' or it could be B10M3T22 '


where the order is not always the same, and you have to read them in pairs:
B1 - M2 - T2


After the split should generate a DataTabele:


CHAR INT
    B     1
    M     2
    T     2


For the split I was using as a separator char array, but I have control over the order ...


Suggestions?


Thank You.

Answers (4)