contains

We’d love to hear your thoughts on the next set of proposals for the JavaScript language. You can find a description of the proposals here.
Please take two minutes to fill out our short survey.

contains 関数は、第 1 引数の文字列に第 2 引数の文字列が含まれているかどうかを判定し、論理値 true または false を返します。

構文

contains(haystack ,needle )

引数

haystack

検索される文字列

needle

haystack の部分文字列かどうかを検索する文字列

返値

haystackneedle が含まれていれば true。 そうでなければ false

定義

Gecko でのサポート

サポート済み。