关于CString的问题 请问,如果想去掉一个字符串的前面几个和最后几个该怎么办?比如":10000000DF00DF01DF01DF01DF01DF01DF010100D0"我想得到中间的"DF00DF01DF01DF01DF01DF01DF010100",去掉了前面的9个和后面的2个 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以使用CString的Mid函数啊。随便取第几个到第几个 或者使用Left和right去头去尾。CString str = ":10000000DF00DF01DF01DF01DF01DF01DF010100D0";str = str.Mid(9,str.GetLength()-9);str = str.Left(str.GetLength() - 2); 是否去掉的数目都是确定的,如果是或者即使不是但有方法可以算出,都好办CString Left( int nCount ) const;throw( CMemoryException );CString Right( int nCount ) const;throw( CMemoryException );或者CString Mid( int nFirst, int nCount ) const;throw( CMemoryException ); 如果前后去掉的数目是确定的或者可以算出的都好办Right和Left或者Mid都是CString的函数,查下MSDN 使用Mid、Left、Right可随心所欲取字符串中的一部分。 如何在编写的Dll中调用动态链接库 BMP图 24位转8位的问题 买过《深入解析ATL(第二版)》的进来说下 通过原始套接字截取本地网卡的所有数据 在VC++中如何找到.cpp文件? 怎样设置release? 问个vc小问题 0x5f42df04指令引用的0xfffffff6内存不能为read MFC的ODBC里,如何将当前记录指针移到指定的记录上? VC下调用怎么调用BCB的动态库 提一个超级简单的问题:怎么识别字符 有关线程监控的问题,谢谢
CString str = ":10000000DF00DF01DF01DF01DF01DF01DF010100D0";
str = str.Mid(9,str.GetLength()-9);
str = str.Left(str.GetLength() - 2);
CString Left( int nCount ) const;
throw( CMemoryException );
CString Right( int nCount ) const;
throw( CMemoryException );
或者
CString Mid( int nFirst, int nCount ) const;
throw( CMemoryException );
Right和Left
或者Mid
都是CString的函数,查下MSDN