Strings

Strings

  • Strings can consist of letters and other characters

  • They are surrounded by either double quotes or single quotes (this is how you recognize you are working with a string)

  • Concatenation allows you to combine strings

// declare a variable called color and store a string

let color = "green";

Single or double quotes can be used for strings, but the opening quote must match the closing quote


String Methods

  • Javascript has some built-in methods that allow developers to work with strings

  • For example: if you wanted to know how many characters were in a string, you would use the .length method

  • Here are some example of other methods you can use on strings

JS Bin on jsbin.com

Click here for complete list of all the String methods