How can I delete unnecessary full-width and half-width spaces from strings of characters on DA?

Follow

You can delete spaces from strings of characters if you use the "replaceAll" function.

The "replaceAll" function is a regular expression that replaces all matching subtexts with the specified characters.


<Example>Setting format of the "replaceAll" function.
   =replaceAll(source text(variables are possible),”text to change”,”text to change to”)
         
Below is the procedure to delete spaces with an Assign step.

Procedure

Precondition:A text variable is set in "Variables"

1. Add an Assign step. (cf. ① in the figure below)

2. In "Variable", specify the TEXT variable that stores your string of characters.

3. In "Expression", enter "Full-width half-width space deletion?".

4. Add an "Assign" step. (cf. ② in the figure below)

5. In "Variable", specify the TEXT variable that stores your string of characters.

6. In "Expression", enter "=replaceAll(TEST," ","")" (this deletes all full-width spaces).

7. Add an Assign step. (cf. ③ in the figure below)

8. In "Variable", specify the TEXT variable that stores your string of characters.

9. In "Expression", enter "=replaceAll(TEST," ","")" (this deletes all half-width spaces).

▼Overall representation of the flow

1.png

▼Output results

2.png

Notes

  • The "replaceAll" function discriminates between full-width spaces and half-width spaces; so it is important to be specific.
  • You can store your string of characters without spaces anymore in a variable with an Assign step, but you can also handle the text after the change with an Enter Text step.
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.