阿里小号专属小号:vc++中如何把一个字符串分成2个 假设字符串中见有1个空格 例如"hello xf"
来源:百度文库 编辑:中科新闻网 时间:2024/05/05 04:58:48
无
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);
判断字符串中间的空格如果发现空格就提取空格前后的数据各存到相应的字符串数组中去