---
# System prepended metadata

title: String methods

---

# String methods

Strings are used for holding text. There are three different ways to create strings in JavaScript:

Single Quotes 'text'
Double Quotes "text"
Backticks `text`

# Backticks

Example: const name = 'Wes';
const hello = `hello my name is ${name}. Nice to meet you`;

```javascript=
var user = "john";

// first letter
console.log(user[0])
// output
// j

// find string range
console.log(user.substring(1, 3))
// output
// oh


// to upper case conversion
user.toUpperCase()

// to lower case conversion
user.toLowerCase()



// Capitalize Each of an array of names
var names = ["john", "JACOB", "jinGleHeimer", "schmidt"];

// first Character list
var capstr = names.map(function(value){
   return value[0];
})

// output
// ["j", "J", "j", "s"]


// other Character list
var capstr = names.map(function(value){
   return value.substring(1, value.length);
})
// output
// ["ohn", "ACOB", "inGleHeimer", "chmidt"]

// final work
var capstr = str.map(function(value){
   return value[0].toUpperCase() + value.substring(1, value.length).toLowerCase();
   })
// output
// ["John", "Jacob", "Jingleheimer", "Schmidt"]
```

