String, Batch Replace to UpperCase

String, Batch Replace to UpperCase
Replaces lowercase letters in the text with corresponding uppercase letters. An input of “ABC”, “Abc”, “abc” will all be output as “ABC”. It is used to store case-insensitive data such as MS-DOS file names or BASIC codes.
Configs
  • A: Set Input Text *#{EL}
  • B: Select STRING DATA for Output Text (update) *
Script (click to open)
// GraalJS Script (engine type: 2)

//////// START "main()" ////////////////////////////////////////////////////////////////
main();
function main(){ 

//// == Config Retrieving / 工程コンフィグの参照 ==
const strInput        = configs.get      ( "StrConfA" );    /// REQUIRED
  if( strInput      === "" ){
    throw new Error( "\n AutomatedTask ConfigError:" +
                     " Config {A: String} is empty \n" );
  }
const strPocketOutput = configs.getObject( "SelectConfB" ); /// REQUIRED


//// == Data Retrieving / ワークフローデータの参照 ==
// (Nothing. Retrieved via Expression Language in Config Retrieving)


//// == Calculating / 演算 ==
let strOutput = strInput.toUpperCase();
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
// https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase


//// == Data Updating / ワークフローデータへの代入 ==
engine.setData( strPocketOutput, strOutput );


} //////// END "main()" /////////////////////////////////////////////////////////////////

/*
Notes:
- When the process reaches the automated step, the Input Text will be automatically evaluated.
    - All lowercase letters in the string are replaced at once.
- Replaces not only the ISO Basic Latin Alphabet (26 characters),
    - but also Western European characters with uppercase and lowercase.
    - So-called double-byte characters are also replaced. (eg "a" to "A")
    - Characters with no uppercase and lowercase letters (such as kanji and katakana) are not replaced.
    - Some language characters with non-one-to-one case mapping may not be replaced as intended.
- See JavaScript `String.prototype.toUpperCase()` for details on replacement specs.
    - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase

Notes-ja:
- 案件が自動工程に到達した際、「入力テキスト」の文字列が評価されます。
    - 文字列中にある小文字が全て一括して置換されます。
- ISO基本ラテンアルファベット(26文字)のみならず、大文字小文字が存在する西欧系言語の文字が置換されます。
    - いわゆる全角文字も置換されます。(例 "a" → "A" )
    - 大文字小文字が存在しない文字(漢字やカタカナなど)は置換されません。
    - 大文字小文字のマッピングが1対1でない一部の言語文字では意図通りに置換されない可能性があります。
- 置換ルールに関する詳細仕様は JavaScript `String.prototype.toUpperCase()` を参照してください。
    - https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
*/

Download

2022-08-17 (C) Questetra, Inc. (MIT License)
https://support.questetra.com/addons/string-batch-replace-to-uppercase-2022/
The Addon-import feature is available with Professional edition.
How to add on: (M415: Adding an Auto-Step to be Used in a Business Process Definition)
Freely modifiable JavaScript (ECMAScript) code. No warranty of any kind.

Notes

  • When the process reaches the automated step, the Input Text will be automatically evaluated.
    • All lowercase letters in the string are replaced at once.
  • Replaces the ISO Basic Latin Alphabet (26 characters).
    • Western European characters that have uppercase and lowercase are replaced.
    • So-called double-byte characters are also replaced (e.g. “a” to “A”).
    • Characters with no uppercase and lowercase letters (such as kanji and katakana) are not replaced.
    • Some language characters with non-one-to-one case mapping may not be replaced as intended.
  • See JavaScript String.prototype.toUpperCase() for details on replacement specs.

Capture

Replaces lowercase letters in the text with corresponding uppercase letters. An input of "ABC", "Abc", "abc" will all be output as "ABC". It is used to store case-insensitive data such as MS-DOS file names or BASIC codes.

See also

String, Batch Replace Fullwidth Numbers with Halfwidth Numbers
Update Data

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Questetra Support

Subscribe now to keep reading and get access to the full archive.

Continue reading

Scroll to Top