我在这个问题上找到了很多答案,但他们都试图先将字符串转换为文件,然后尝试使用解析它XmlDocument doc = new XmlDocument();
我是新手c#
。我的字符串格式是:
<a header = '0'> < row dc = '123' al = '45' msg = '1-st line'/> < row dc = '678' al = '8' msg = 'second-line'/> </a>
我正在尝试编写伪代码来解析它:
IF <a header> == 0
Then read from the second line to last line i.e. dc = 678 , al = 8, msg = second-line
ELSE read from the first line to last line i.e.
dc = 123 , al = 45, msg = 1-st line
dc = 678 , al = 8, msg = second-line
在此之后我必须插入数据库。在应用上述条件时,什么是合适的解决方案?