string methods = allow you to manipulate and work with text (strings)

let username = "BroCode";
 
//.charAt()
console.log(userName.charAt(0)); //get the character at index 0, the output sould be "B"
 
//.indexOf()
console.log(userName.indexOf("o")); // get the first currence index of the letter "o", the output should be "2"
 
//.lastIndexOf()
console.log(userName.lastIndexOf("o")); //get the last currence index of the letter "o", the output sould be "4"
 
//.legnth
console.log(userName.length); //how many characters, the output should be "7"
 
//.trim()
userName = userName.trim(); //here can trim any white space
console.log(userName);
 
//.toUpperCase() .toLowerCase()
userName = userName.toUpperCase();
console.log(userName);
 
//.repeat()
userName = userName.repeat(3); //here should repeat 3 times
console.log(userName);
 
//.startsWith() .endsWith() .includes()
result = userName.startsWiths(" "); //check if the string start with a space
console.log(result); //output a boolean, true/false\
 
//.replaceAll()
let phoneNumber = "123-456-7890"
phoneNumber = phoneNumber.replaceAll("-",""); //here replace all "-" to no character