Skip to content

Javascript String Tutorial

Replace SubString

javascript
let text = "Visit Microsoft!";
let result = text.replace("Microsoft", "SeaCode");
let text = "Visit Microsoft!";
let result = text.replace("Microsoft", "SeaCode");

Convert a number to a string

javascript
let num = 15;
let text = num.toString();
let num = 15;
let text = num.toString();