mirror of https://gitee.com/bigwinds/arangodb
contains()
This commit is contained in:
parent
86874a8def
commit
2b841bacf7
|
@ -1293,6 +1293,19 @@ function AHUACATL_STRING_SUBSTRING (value, offset, count) {
|
||||||
return value.substr(offset, count);
|
return value.substr(offset, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief searches a substring in a string
|
||||||
|
///
|
||||||
|
/// the two input operands must be strings or this function will fail
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
function AHUACATL_STRING_CONTAINS (value, search) {
|
||||||
|
AHUACATL_ARG_CHECK(value, AHUACATL_TYPEWEIGHT_STRING, "CONTAINS");
|
||||||
|
AHUACATL_ARG_CHECK(offset, AHUACATL_TYPEWEIGHT_STRING, "CONTAINS");
|
||||||
|
|
||||||
|
return value.indexOf(search) != -1;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @}
|
/// @}
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -1295,6 +1295,19 @@ static string JS_server_ahuacatl =
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
"\n"
|
||||||
"////////////////////////////////////////////////////////////////////////////////\n"
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
||||||
|
"/// @brief searches a substring in a string\n"
|
||||||
|
"///\n"
|
||||||
|
"/// the two input operands must be strings or this function will fail\n"
|
||||||
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
||||||
|
"\n"
|
||||||
|
"function AHUACATL_STRING_CONTAINS (value, search) {\n"
|
||||||
|
" AHUACATL_ARG_CHECK(value, AHUACATL_TYPEWEIGHT_STRING, \"CONTAINS\");\n"
|
||||||
|
" AHUACATL_ARG_CHECK(offset, AHUACATL_TYPEWEIGHT_STRING, \"CONTAINS\");\n"
|
||||||
|
"\n"
|
||||||
|
" return value.indexOf(search) != -1;\n"
|
||||||
|
"}\n"
|
||||||
|
"\n"
|
||||||
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
||||||
"/// @}\n"
|
"/// @}\n"
|
||||||
"////////////////////////////////////////////////////////////////////////////////\n"
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
|
Loading…
Reference in New Issue