PrevUpHomeNext

esv::str_to


Love animals, cherish life.

esv::str_to

esv::str_to is a class object function to convert std::string string to other string type: std::wstring, std::u8string, std::u16string, std::u32string.

Note that any one of std::string, std::string_view and const char * will be treated as std::string.

Calling Sig:

auto result = esv::str_to<string_type>(std_string_value);

cpp example

cpp/c++ example

#include <esvcpp/core.hpp>

int main()
{
	std::string s1 = "Hello c++!";
	const char * s2 = "c++ Hello!";
	auto s3 = esv::str_to<std::wstring>(s1);
	auto s4 = esv::str_to<std::wstring>(s2);
	esv::wprint(s3, s4);
}

See Also

esv::print

esv::wprint


PrevUpHomeNext

esv::print