Description:
Define a string constant.
Syntax:
"string" or $[string]
Note:
An expression must be double quoted in use. But the quotation marks are not required if the string constants are defined directly.
The macro in "string" will not be replaced. When copying/pasting/inserting/deleting the row, the cell referenced by "string" will not change automatically.
The macro in $[string] will be replaced. When copying/pasting/inserting/deleting the row, the cell referenced by $[string] will change automatically.
The double quotation marks in $[string] do not need an escape character; while the double quotation marks in "string" needs one.
Parameter:
string |
Contents of the string, which can be any character. |
Return value:
String constant
Example:
"asd"
$[asd]
The the cell referenced by the string enclosed in $[] will change automatically when copying/pasting/inserting/deleting a row,but the one referenced by the string enclosed in "" will not change automatically in the same situation.
The macro in $[] will be replaced automatically, while macro in "" will not.
"${arg1}abc" |
"${arg1}abc " |
$[${arg1}abc] |
"Tomabc", (Suppose the value of arg1 is "Tom") |
The double quotation marks in $[] do not need to be escaped; while the escaping of double quotation marks in "" is needed.
$[a"s]
"a\"s"
Related function:
String concatenation
Here are types of string concatenation.
Description:
Join two or more strings end-to-end.
Syntax:
x+y
Note:
A string and a numeric value cannot be concatenated.
Parameter:
x |
A string constant |
y |
A string constant |
Return value:
A string formed by joining x and y.
Example:
"abc"+"def" |
abcdef |
"abc"+123 |
123. A string and a numeric value cannot be concatenated. |
Description:
Concatenate a string with one or more pieces of non-string data.
Syntax:
x/y
Note:
Either x or y is a string. The function will convert the non-string type one to a string before concatenating them to a larger one.
Parameter:
x |
Data of any type, with the condition that either x or y is a string. |
y |
Data of any type, with the condition that either x or y is a string. |
Return value:
A string
Example:
"abc"/12 |
abc12 |
date("2015-03-12")/"abc" |
2015-03-12abc |