O'Reilly logo

Web Technology: Theory and Practice by M. Srinivasan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.7 BASIC STRING OPERATIONS

Strings are sequences of zero or more Unicode characters. String literals are enclosed within single or double quotes. Since CSJS involves working with HTML, a set of single quoted string literals can be embedded within a set of double quoted HTML or vice versa. For example,

<a href=“#” onClick=“alert(‘continue’)”> Click </a>

Strings are immutable in the sense that their values cannot be modified at a specific location. There is a charAt() method but nothing for setting a character at a specific location.

One of the most often used features pertaining to Strings is the concat operator. The ‘+’ operator is used for this purpose, overloaded with the (same) arithmetic operator.

Some of the basic string operations are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required