本文目录
一道C语言的题目:多行文本的输出及多余空格的删除
下面的这个函数借助windows的CString将多个空格替换成一个.CStringRemoveDuplicateSpace(LPCTSTRtext){CStringsReturn=text;if(sReturn.Replace(_T(““),_T(““))》0)returnRemoveDuplicateSpace(sReturn);returnsReturn;}只要把数组中的文本逐一用此函数处理后输出即可.
下面的这个函数借助windows的CString将多个空格替换成一个.CStringRemoveDuplicateSpace(LPCTSTRtext){CStringsReturn=text;if(sReturn.Replace(_T(““),_T(““))》0)returnRemoveDuplicateSpace(sReturn);returnsReturn;}只要把数组中的文本逐一用此函数处理后输出即可.