Navigation: Developing Apps > BINETIX® AGE™ API > The Node > Toolkits > age_lists
positions/2
Description
positions/2 is an Erlang function exported by "age_lists" module.
Returns the positions of a term (token) found into a list with terms.
This function could be quite useful for analyzing ASCII strings as list of bytes.
References
None
Parameters
Name
Type
Input
list() | string()
Input list of terms or a string sequence.
Token
integer()
Token to be found.
Result
Value or Type
list()
Returns list with positions.
Code Sample
> age_lists:positions([a, 32, b, 3, 32, c], 32). [2, 5] > age_lists:positions("The quick brown fox jumps over the lazy dog", 32). [4, 10, 16, 20, 26, 31, 35, 40]