A
T

<-- Back to Tags

{AT(needle, haystack)}

Searches for needle in haystack and returns the position of the first occurance. If not found, or needle or haystack is empty, 0 is returned. Searches are case sensitive so 'M' will not be found in 'example'. Returned positions start at 1.

Example

{AT(world, Hello world)}

returns

7

First character is at position 1

{AT(H, Hello world)}

returns

1

Case example (uppercase character does not exist in haystack)

{AT(L, Hello world)}

returns

0

Parameters
Number Name Default Type Description
1 needle String The string to search for.
2 haystack String The string to search in.
Log in to add a Comment.