StringReplace

The StringReplace function replaces a string in the input stream.

Input/Output

Number of Connections: 1
InputData TypeDescription
Input1StringThe string to be modified.

OutputData TypeDescription
Output1StringThe modified string.

Property

NameProperty TypeDescription
Modechoice Specifies whether the substitution table used is read from a file or if the InlineTable is used.

File - The substitution table used is read from a file.
Inline - The InlineTable substitution table is used.
HomeDirectorypathResolverSpecify the base folder of relative path of table file.
Project folder [Relative]
Start point is the same folder as the project file.
Home folder [ProjectOwner]
Start point is the projedct owner's home folder.
Executing user home folder [ExecuteUser]
Start point is the execute user's home folder.
FilePathremoteFile If Mode=File, this property specifies the file's path. The file under the user's home folder can be specified.
FileEncodingchoice IfMode=File, this property specifies the table file's character encoding.
InlineTablestring If Mode=Inline, this property specifies the inline substitution table's data.

Substitution table format

A substitution table may contain multiple rows, each row specifying the string to replace and the string to replace it in the form "string_to_replace=replacement_string".

abcde=ABCDE
01234=56789

The example substitution table above will replace the strings "abcde" with "ABCDE, and the strings "01234" with "56789".

The escape character \ can be used in the substitution table to create the following escape characters.

\rCR
\nLF
\tTab
\==
\\\
\uXXXXthe XXXX Unicode character

Loading table

When Mode is set to "File", contents of table is loaded at first execution in each request. This loaded contents is used in the same function in the same request until this request ends. In another words, the same loaded table is used even if the function is in the loop or it is used in subflow. When loading a table, it is checked whether the file is updated or not. If the file is not updated, it is not loaded in next request.

The mutual conversion of Windows-31J and JIS system character-code

In Java, the character code is distinguished between in Windows-31J and in JIS system like Shift_JIS, EUC-JP, iso-2022-jp. Typically, the conversion between these character encoding is possible. But, because some characters have different code point of Unicode, the conversion will fail.
These are following 7 characters.

CharacterCode in Windows-31J(Or Shift_JIS)Converted code by Windows-31JConverted code by Shift_JIS
815C20152014
8160FF5E301C
816122252016
817CFF0D2212
8191FFE000A2
8192FFE100A3
81CAFFE200AC

If the conversion is failed in flow, using following table will avoid failure.


- From Windows-31J to JIS system code
\u2015=\u2014
\uFF5E=\u301C
\u2225=\u2016
\uFF0D=\u2212
\uFFE0=\u00A2
\uFFE1=\u00A3
\uFFE2=\u00AC
- From JIS system code to Windows-31J
\u2014=\u2015
\u301C=\uFF5E
\u2016=\u2225
\u2212=\uFF0D
\u00A2=\uFFE0
\u00A3=\uFFE1
\u00AC=\uFFE2