lastIndexOf(array: Array, value: Any): Number 特定の配列の指定された要素の最後の出現のインデックスを返し、この配列に要素が含まれていない場合は -1 を返します。 DataWeave バージョン 2.4.0 で導入されました。 パラメーター 名前 説明 array 検索する要素の配列。 value 検索する値。 例 次の例では、さまざまな入力での indexOf の動作を示します。 ソース %dw 2.0 output application/json --- { present: ["a","b","c","d"] lastIndexOf "c", notPresent: ["x","w","x"] lastIndexOf "c", presentMoreThanOnce: ["a","b","c","c"] lastIndexOf "c", } 出力 { "present": 2, "notPresent": -1, "presentMoreThanOnce": 3 } lastIndexOf(array: String, value: String): Number 文字列を入力として取得し、入力内の特定の検索文字列の最後の出現のインデックスを返します。検索文字列が入力に存在しない場合、この関数では -1 を返します。 DataWeave バージョン 2.4.0 で導入されました。 パラメーター 名前 説明 string 検索する文字列。 value 入力文字列内で検索する文字列値。 例 次の例では、さまざまな入力での indexOf の動作を示します。 ソース %dw 2.0 output application/json --- { present: "abcd" lastIndexOf "c", notPresent: "xyz" lastIndexOf "c", presentMoreThanOnce: "abcdc" lastIndexOf "c", } 出力 { "present": 2, "notPresent": -1, "presentMoreThanOnce": 4 } lastIndexOf(array: Null, value: Any): Number lastIndexOf を null 値に使用できるようにするヘルパー関数。 DataWeave バージョン 2.4.0 で導入されました。
lastIndexOf(array: Array, value: Any): Number 特定の配列の指定された要素の最後の出現のインデックスを返し、この配列に要素が含まれていない場合は -1 を返します。 DataWeave バージョン 2.4.0 で導入されました。 パラメーター 名前 説明 array 検索する要素の配列。 value 検索する値。 例 次の例では、さまざまな入力での indexOf の動作を示します。 ソース %dw 2.0 output application/json --- { present: ["a","b","c","d"] lastIndexOf "c", notPresent: ["x","w","x"] lastIndexOf "c", presentMoreThanOnce: ["a","b","c","c"] lastIndexOf "c", } 出力 { "present": 2, "notPresent": -1, "presentMoreThanOnce": 3 } lastIndexOf(array: String, value: String): Number 文字列を入力として取得し、入力内の特定の検索文字列の最後の出現のインデックスを返します。検索文字列が入力に存在しない場合、この関数では -1 を返します。 DataWeave バージョン 2.4.0 で導入されました。 パラメーター 名前 説明 string 検索する文字列。 value 入力文字列内で検索する文字列値。 例 次の例では、さまざまな入力での indexOf の動作を示します。 ソース %dw 2.0 output application/json --- { present: "abcd" lastIndexOf "c", notPresent: "xyz" lastIndexOf "c", presentMoreThanOnce: "abcdc" lastIndexOf "c", } 出力 { "present": 2, "notPresent": -1, "presentMoreThanOnce": 4 } lastIndexOf(array: Null, value: Any): Number lastIndexOf を null 値に使用できるようにするヘルパー関数。 DataWeave バージョン 2.4.0 で導入されました。