create a dictionary or list from string(HTML tag included) in C#

Posted by loviji on Stack Overflow See other posts from Stack Overflow or by loviji
Published on 2010-03-07T19:45:51Z Indexed on 2010/03/08 20:51 UTC
Read the original article Hit count: 619

Filed under:
|
|

Hello, A have a string like this:

string s = @"
    <tr>
    <td>11</td><td>12</td>
    </tr>
    <tr>
    <td>21</td><td>22</td>
    </tr>
    <tr>
    <td>31</td><td>32</td>
    </tr>";

How to create Dictionary<int, int> d = new Dictionary<int, int>(); from string s to get same result as :

d.Add(11, 12);
d.Add(21, 22);
d.Add(31, 32);

© Stack Overflow or respective owner

Related posts about c#

Related posts about html-parsing