SizeOfString

See Also: Length, WString, Data Types, Variables and Constants

Purpose

SizeOfString returns the size of a string in bytes (UTF-8 code-units).

Return Type

Integer

Syntax

(SizeOfString ( {string-value} ))

What It Does

This function returns the size of a string in bytes (UTF-8 code-units). This can be different than the length returned by the Length function, which returns the number of characters (UTF-8 code points) in a string.

 

Example

Integer iLen

Pointer pData

String sValue

 

Move (SizeOfString(sValue)) to iLen // length to copy

Move (AddressOf(sValue)) to pData   // first byte of string

Set Field_Current_Pointer_Value iField iLen to pData