首页 新闻 赞助 找找看

关于字符串处理..将其封装成实体对象

0
悬赏园豆:30 [已关闭问题] 关闭于 2012-10-27 16:42

现在有一条字符串

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;

 

能有方法实现吗?

Poiuyt_cyc的主页 Poiuyt_cyc | 初学一级 | 园豆:24
提问于:2012-10-27 15:47
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册