点击查看详细介绍

删字符串首尾空格功能函数代码,会经常用到的一个功能函数

nxopen 7年前 1943 4

购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008  QQ号:85585969  


//删字符串首尾空格,会经常用到的一个功能函数string trim(std::string &s)   
{  
	if (s.empty())   
	{  
		return s;  
	}  
	s.erase(0,s.find_first_not_of(" "));  
	s.erase(s.find_last_not_of(" ") + 1);
	return s;  
}


2

最新回复 (4)
  • wgp1109 7年前
    1

    谢谢分享!!!!!!

  • tempuu 7年前
    2

    谢谢分享!!!!!!谢谢分享!!!!!!

  • szsxlmk 7年前
    3

    00000000000000

  • caoming0781 7年前
    4

    哒哒哒哒哒哒多多多多

请登录后发表新帖