PrevUpHomeNext

utx::str_to


utx::str_to

utx::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 = utx::str_to<string_type>(std_string_value);

cpp example

cpp/c++ example

#include <utxcpp/core.hpp>

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

See Also

utx::print

utx::wprint


PrevUpHomeNext

utx::print

esv::print