Programming Strings

By: Dusty Arlia
Published on Friday, August 30, 2013, 10:13 PM
Last Updated on Tuesday, July 14, 2015 at 1:59 PM
Total Updates: 2

A string is a series of letters and other symbols. Strings are variables that can hold the value of a name, sentence, title, or even programming code. In many programming languages, you can place your string in between quotation marks. For example, you can use double quotes ("Hello world") or single quotes ('Hello world'). It doesn't matter which type of quote you use, just don't mix them. For example don't do this: "Hello World'. Learn more about using quotes properly in JavaScript strings.

If you are programming in JavaScript, a string's opening quotation mark signals to the JavaScript interpreter that what follows is a string. The interpreter interprets each character of the string literally (as opposed to having a special meaning in the JavaScript language). When the JavaScript interpreter encounters the closing quotation mark, it knows it has reached the end of the string. Here's an example of a string inside the JavaScript alert() function:

alert("Hello World!");