Standard64.WLEN Log in to Edit

[Libraries] > [Standard64] Library Documentation > String Functions > WLEN (FUN)


Content from Online Help


Libraries (3.5.15.0) > Standard64 Library Documentation > String Functions > WLEN (FUN)

WLEN (FUN)

FUNCTION WLEN : INT

String length function. Returns the number of wcharacters in STR.

InOut:

Scope Name Type
Return WLEN INT
Input STR WSTRING(255)

Click "Details" to expand


Forge Community Additional Documentation

This function is limited to a WSTRING of 255 words. For longer WSTRINGs you can use [StringUtils.StrLenW] (V3.5.15.40 @i-campbell)

This returns the number of WORDs used in the WSTRING, not including the Terminating NULL character. So this is not the actual number of "characters" to for example pad a string for display purposes. As WSTRINGs are UTF-16, WLEN("a") = 1, but WLEN("𐐷") = 2 (V3.5.15.40 @i-campbell)

Engineering / How long can a WSTRING be in CodeSys V3?


Related

Forked Help Wiki: Home
Forked Help Wiki: Libraries
Forked Help Wiki: Standard64