std::string data = "This is a sample string.";
 
	// convert string to upper case
	std::for_each(data.begin(), data.end(), [](char & c) {
		c = ::toupper(c);
	});
 
	std::cout << "In Upper Case : " << data << std::endl;
 
	// convert string to back to lower case
	std::for_each(data.begin(), data.end(), [](char & c) {
		c = ::tolower(c);
	});
 
	std::cout << "In Lower Case : " << data << std::endl;


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
  • 2022-02-14
  • 2021-08-05
  • 2022-12-23
  • 2021-11-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
相关资源
相似解决方案