The char data type can store a single character.
A string value is a chain of zero or more characters (letters, digits, and punctuation marks) strung together. You use the string data type to represent text in JScript.
String and char values are enclosed in single (') or double (") quotation marks. You may use any of these marks, but always close with the same type of quotation mark as you opened it with. This is very convenient for example in strings such as:
"I can't stand this anymore"'"This is too much for me", he said.'
Note: When you write JScript .NET code, you can have as many line breaks and blanks as you like in your code, but never have a line break inside a string. If you have a line break inside a string, you will get an error message.
However, there are codes you can insert for special formatting characters. E.g. for a line break use \n:
"I need a line break here\n and want to continue on the next line"
For apostrophe, use \':
'I can\'t stand this anymore'
Below is a table describing the special formatting characters:
Character |
Meaning |
\' |
Single quote |
\" |
Double quote |
\\ |
Backslash |
\n |
New line |
\r |
Carriage return |
\t |
Horizontal tab |
\b |
Backspace |
A string that contains zero characters ("") is an empty (zero-length) string.
There is a significant difference between the string "123" and the number 123. The number 2 will be a smaller value than the number 123. But the string "2" is larger than the string "123", because the first character in the string is compared first, and the character 2 is larger than the character 1 (the same system as is used in alphabetical listings such as dictionaries and telephone directories). All values are stored as strings in the survey questions, so you must convert them to numbers if you want them to be evaluated as numbers. Click here for details.
Unicode
Jscript.NET supports Unicode characters in strings. They can be used like any other characters, but note that the encoding of the survey pages will be set according to the settings for the active language, so that for example for English, which by default will be set to have encoding “Western European (ISO)”, Unicode characters will not be displayed correctly on the survey page. Only Unicode languages will display Unicode characters correctly. You should also ensure you set the right codepage (Unicode - 65001) if using Unicode characters in SendMail and SendMailMultiPart scripts.