underscore(text: String): String 文字列内のハイフン、スペース、キャメルケースをアンダースコアに置き換えます。 ハイフン、スペース、キャメルケースが存在しない場合、出力は入力と一致します。 パラメーター 名前 説明 text 入力文字列。 例 次の例では、入力のハイフンとスペースを置き換えます。入力「customer」は、出力で変更されていません。 ソース %dw 2.0 import * from dw::core::Strings output application/json --- { "a" : underscore("customer"), "b" : underscore("customer-first-name"), "c" : underscore("customer NAME"), "d" : underscore("customerName") } 出力 { "a": "customer", "b": "customer_first_name", "c": "customer_name", "d": "customer_name" } underscore(text: Null): Null underscore を null 値に使用できるようにするヘルパー関数。
underscore(text: String): String 文字列内のハイフン、スペース、キャメルケースをアンダースコアに置き換えます。 ハイフン、スペース、キャメルケースが存在しない場合、出力は入力と一致します。 パラメーター 名前 説明 text 入力文字列。 例 次の例では、入力のハイフンとスペースを置き換えます。入力「customer」は、出力で変更されていません。 ソース %dw 2.0 import * from dw::core::Strings output application/json --- { "a" : underscore("customer"), "b" : underscore("customer-first-name"), "c" : underscore("customer NAME"), "d" : underscore("customerName") } 出力 { "a": "customer", "b": "customer_first_name", "c": "customer_name", "d": "customer_name" } underscore(text: Null): Null underscore を null 値に使用できるようにするヘルパー関数。