查看单个帖子
旧 2009-04-16, 12:08 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】[arx]如何提取多行文字有效字符?

[arx]如何提取多行文字有效字符?
[arx]如何提取多行文字有效字符?
假如有一多行文字,其内容为:
{\fnsimsun|b0|i0|c134|p49;\c0;明\fsimsun|b0|i0|c134|p2;\c3;经\c6;通\c4;道\ffangsong
  _gb2312|b0|i0|c134|p49;}
如何用c++提取到其有效字符“明经通道”呢?
contents()函数不行吗?
哈哈,{\fnsimsun|b0|i0|c134|p49;\c0;明\fsimsun|b0|i0|c134|p2;\c3;经\c6;通\c4;道\ffangsong_gb2312|b0|i0|c134|p49;}
这个内容就是从contents()里得到的
使用explode()函数,得到系列acdbtext对象,再次调用acdbtext::textstring()即可得到你想要的内容!
以下是引用gxss在
thank you
这样可以不用炸开多文本,提取出纯文本
cstring str;
str.format("%s",pmtext->contents());
int pot=str.find(';');
int pot2=str.find('}');
int num=pot2-pot-1;
str=str.mid(pot+1,num);
char *a=(lptstr)(lpctstr)str;
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)