String Type
You can designate String constants using single or double quotes:
var mystring = "InetSoft Technology Corp."
mystring = 'InetSoft Technology Corp.'
Concatenate strings with the plus operator:
var str = 'Total: ' + total;
If a value concatenated to a string is of a different type, it is converted to a string automatically. Strings have many methods, for example, substring(), toLowerCase(), toUpperCase() and indexOf().
var str = 'abcd';
str = str.toUpperCase(); // converts to ABCD
var bIdx = str.indexOf('B'); //return 1
str = str.substring(1, 2); // return 'b'
Strings have built-in support for regular expressions. You can find a regular expression in a string using the match() or search() method:
str = 'this is a test of regular expression';
re = /test/; // create a regular expression
var idx = str.search(re); // return the position of the regular expression