Skip to main content

String length

Anatomy

<length var="var">
string
</length>

Description: LENGTH returns the string length of a value in characters.

Attention:

The string length of a multibyte character sequence may not match the size of its binary representation.

Attributes

NameTypeDescriptionDefined By
varvarResult variable name length

Results:

BindingTypePredicate
varintN/A

Examples

Example

<set var="name">iXML</set>
<length var="len">$name</length>

<if value1="$len" func="&gt;" value2="0">
<output>My name contains more than zero characters!</output>
</if>

<!-- My name contains more than zero characters! -->