PrevUpHomeNext

utx::wstr_size


utx::wstr_size - Utxcpp

utx::wstr_size - A function object to get the length of a wide string: get the character counter.

utx::str_size_class

The function object is the object of instantiated template class utx::str_size_class .

Get String Size - How

Get Array String Size

It gets string size by template type traits.

Get const type_xt * or type_xt * String Size

It gets string size by searching until '\0' is found.

It works on both string literal or string made by new.

For utx::str_size, type_xt is char; for utx::wstr_size, type_xt is wchar_t, ..., etc.

c++ example

#include <utxcpp/core.hpp>
#include <utxcpp/numeric.hpp>	// utx::iota

int main()
{
	wchar_t s1[] = L"Hell c++!";
	constexpr const wchar_t * s2 = L"Hell c++!!";
	wchar_t * s3 = new wchar_t[23];
	utx::iota(s3, L'0');
	s3[11] = L'\0');

	constexpr auto sz1 = utx::wstr_size(s1);
	constexpr auto sz2 = utx::wstr_size(s2);
	auto sz3 = utx::wstr_size(s3);

	utx::print(sz1, sz2, sz3);
}

See Also

utx::str_size

utx::u8str_size

utx::u16str_size

utx::u32str_size

utx::print


PrevUpHomeNext

utx::print

esv::print