indexOf indexOf
2 番目のパラメーターが最初に現れる(最初の引数内の)位置を返します。一致するものがない場合は -1 を返します。
カテゴリ
文字列
関数の構文
indexOf(<parameters>)
パラメーター
パラメーター
タイプ
string
String
指定値
文字列
シグネチャと戻り値のタイプ
indexOf(<string>,<string>)
整数を返します。
例
indexOf("Hello", "l")
2 を返します。
説明:
「Hello」で「l」が最初に出現するのは位置 2 です。
recommendation-more-help
b22c9c5d-9208-48f4-b874-1cefb8df4d76