SysUtilsByteLength (C++)
Description
This example illustrates the ByteLength function from the SysUtils unit. The application prints to the console the number of characters and the length in bytes of the string passed as parameter.
Code
int _tmain(int argc, _TCHAR* argv[])
{
UnicodeString s1;
/* Assign the string. */
s1 = "Hello World!";
/* Print to the console the character length and the byte length of the
UnicodeString. */
printf("UnicodeString: %s contains %d, characters in %d bytes.\n",
s1, s1.Length(), ByteLength(s1));
return 0;
}
Uses
- System.SysUtils.ByteLength ( fr | de | ja )
- System.Length ( fr | de | ja )