Loading TOC...

MarkLogic 10 Product Documentation
sql.strpos

sql.strpos(
   target as String?,
   test as String?,
   [collation as String?]
) as Number?

Summary

Returns an integer value representing the starting position of a string within the search string. Note, the string starting position is 1. If the first parameter is empty, the result is the empty sequence.

Parameters
target The string from which to test.
test The string to test for existence in the second parameter.
collation The optional name of a valid collation URI. For information on the collation URI syntax, see the Search Developer's Guide.

Example

sql.strpos("searchintext","chin");

=> 5

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.