テキスト空白のトリム
動詞: trimString
テキストの先頭または末尾、あるいはその両方の空白をトリムします。
構文
trimString --text(String) --trimoption(TrimOptions) (String)=value
入力
| スクリプト | Designer | 必須 | 許容タイプ | 説明 |
|---|---|---|---|---|
| -- テキスト | テキスト | 必須 | テキスト | 先頭または末尾、あるいはその両方の空白をトリムするテキスト。 |
| --trimoption | トリム・オプション | 必須 | TrimOptions | 空白の削除のタイプ。 |
出力
| スクリプト | Designer | 許容タイプ | 説明 |
|---|---|---|---|
| 値 | テキスト | テキスト | 「トリム・オプション」で指定したように空白がトリムされたテキスト。 |
例
テキスト「IBM 」の末尾の空白を削除します。
defVar --name textToTrim --type String --value "IBM "
defVar --name trimmedText --type String
// Trim blanks only at the end (--trimoption "TrimEnd")
trimString --text "${textToTrim}" --trimoption "TrimEnd" trimmedText=value
logMessage --message "${trimmedText}" --type "Info"
// This example produces the following result:
// "IBM".