如何测试一个字符串中是否有空格? 有现成的函数吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 String str;if(str.Trim().Length()==str.Length()) ShowMessage("没空格");else ShowMessage("有空格"); CString::Find int Find( TCHAR ch ) const;int Find( LPCTSTR lpszSub ) const;int Find( TCHAR ch, int nStart ) const;int Find( LPCTSTR pstr, int nStart ) const; std::string str ;str.find() ; cstring str;str.find(" ",0); CString str ="sth";if(str.find(' ') == -1){AfxMessageBox("无空格");}else{AfxMessageBox("有空格");} mfc如何让画图停止,求教各位大神!1 CArray使用问题 VC++ 5版的与VC++ 6版的差别大不大? 如何将字符串中的数字提取出来? 怎么让控件显示在dc画的图上面,dc画图时总是把控件覆盖 简单问题,解决马上结贴,关于固定端口问题。 如何使CListCtrl支持排序? 怎样使list view控件接受文件的托拽?即对拖进的文件做出响应,如显示文件名? 有谁可以介绍一下_variant_t啊,或者哪里有介绍这个的文章啊 大图标与小图标不一样怎么办? vc界面重可以嵌入asp/jps/cgi等页面吗? 请问如何终止一个系统进程
if(str.Trim().Length()==str.Length())
ShowMessage("没空格");
else
ShowMessage("有空格");
int Find( TCHAR ch ) const;int Find( LPCTSTR lpszSub ) const;int Find( TCHAR ch, int nStart ) const;int Find( LPCTSTR pstr, int nStart ) const;
str.find() ;
str.find(" ",0);
{
AfxMessageBox("无空格");
}
else
{
AfxMessageBox("有空格");
}