现在有一条字符串
string a=
“Item=123 herf=xxx.aspx id=1
Items=1234 herf=xxx.aspx parentid=1
Items=1233 herf=xxx.aspx parentid=1
Items=123 herf=xxx.aspx parentid=1
Item=11herf=xxx.aspx id=2
Items=123 herf=xxx.aspx parentid=2
Items=123 herf=xxx.aspx parentid=2
Items=123 herf=xxx.aspx parentid=2"
现在有2个实体类news和newitems.
news属性为
id
Item;
url;
newsitems;
newsitems属性为
parentid
Item;
url
有没有办法把字符串里的字符封装成对象?
例如Item=123 herf=xxx.aspx id=1
news n=new news();
n.id=1;
n.url=xxx;
能有方法实现吗?