strlen2 — receiving the length for double byte character set string.

Description :

u8 strlen2(u8 *string);

Returns the string length of string in bytes.

List of parameters:

string

Input string or pointer to the string for which the length is measured.

Return values:

The string length of string in bytes in case of success and 0 if string is empty.

Example:

<item addr="524:248" name="Test for strlen2 function" type="script">

	V-ID/V-ADDR 
	{
		if(opt0()) 
		{
			u8 str_1[] = toUcs2(65001, "Test string");

			// Usage of strlen2
			u8 result_1 = strlen2(&str_1);

			 // Usage of strlen for the same string
			u8 result_2 = strlen(&str_1);

			// Result output to the interface
			u8 strForMess[50];
			sprintf(strForMess, "%cstrlen2(&str_1) = %d\10strlen(&str_1) = %d", 1, result_1, result_2);
			setStatus(@exciterId():32, &strForMess);
		}
	}
</item>

The result of performing the example in the interface:

strlen2(&str_1) = 22

strlen(&str_1) = 12