几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(C++) (http://www.dimcax.com/hust/forumdisplay.php?f=34)
-   -   【转帖】[arx]如何提取多行文字有效字符? (http://www.dimcax.com/hust/showthread.php?t=6461)

yang686526 2009-04-16 12:08 PM

【转帖】[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;


所有的时间均为北京时间。 现在的时间是 02:04 AM.