StoreCenter Help : Online Editor : Variable Actions Samples : Insert special characters in variables
Insert special characters in variables
You must use an action to insert special characters such as a non-breaking space, a tab, a carriage return, etc. in a variable.
For the example below, the user must fill in two fields, var1 and var2. You want to combine both variables in a third variable, var3, with a non-breaking space between var1 and var2. Var3 is defined as a calculated field type of variable. Use the following 'Value' action to combine the variables:
Action type: Value
Variable type: Calculated Field
Action code:
1 declare string total = long string
2 set local total = variable var1 value & JavaScript eval script: long string return String.fromCharCode(160)
3 set local total = local total & variable var2 value
4 return local total
In line 2 return String.fromCharCode(160) needs to be entered in the empty field for defining the JavaScript string. '160' refers to the UTF-8 code for a non-breaking space. There are other codes that might be useful: use 9 for a horizontal tab, 13 for a carriage return and 173 for a soft hyphen.
doc. version 6.0.4