Zum Hauptinhalt springen

Position of first/last occurrence

XML
<array:pos var="var" var_result="var" offset="int" type="first">
string
</array:pos>

<array:pos /> finds the position of first or last occurrence of a value within an array and returns the key of the corresponding array item if applicable.

If the offset is negative it will start that many items from the end of the array.

Attributes

NameTypeDescriptionDefined By
varvarVariable name array:pos
var_resultvarResult variable name array:pos
offsetintSearch offset array:pos
typetypeMeasurement type array:pos

Results

BindingTypePredicate
var_resultN/A

Examples

XML
<array var="names">
<item>Bill Gates</item>
<item>Steve Jobs</item>
</array>

<output>
<array:pos var="names">Steve Jobs</array:pos>
</output>

<!-- 1 -->