超蓝悟空十倍界王拳:vc++中如何把一个字符串分成2个 假设字符串中见有1个空格 例如"hello xf"
来源:百度文库 编辑:神马品牌网 时间:2024/05/06 06:08:33
无
to tanyuguo:
谢谢了!最后一行str.GetLength()掉了个g
to tanyuguo:
谢谢了!最后一行str.GetLength()掉了个g
CString str="hello xf";
int x=str.Find(' ');
CString str1=str.Left(x);
CString str2=str.Right(str.GetLenth()-x-1);
判断字符串中间的空格如果发现空格就提取空格前后的数据各存到相应的字符串数组中去