LENW

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Core Language > BuiltIn Functions > String functions >

LENW

 

Description

 

Return the length of a string expression in number of chars.

 

Syntax

 

n = LENW(string_expression)

 

Returns

 

Number

 

Parameters

 

Name

Type

Optional

Meaning

String_Expression

String

No

Any string expression

 

Remarks

 

Useful when dealing with UTF-8 strings where length of the string in bytes is not always the same of the length of the string in number of characters.

 

For example the following string "漢字はユニコード. Hi from thinBASIC"

is 43 bytes but 27 characters.

 

Restrictions

 

See also

 

String Handling, LENF, StrPtrLen, Len

 

Examples