0% found this document useful (0 votes)
2 views

String

The document contains JavaScript code demonstrating various string manipulation techniques. It showcases string interpolation, accessing characters, substring extraction, trimming whitespace, replacing substrings, checking for inclusion, and splitting strings. Additionally, it includes comments indicating potential console log outputs that are currently commented out.

Uploaded by

cihos45202
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

String

The document contains JavaScript code demonstrating various string manipulation techniques. It showcases string interpolation, accessing characters, substring extraction, trimming whitespace, replacing substrings, checking for inclusion, and splitting strings. Additionally, it includes comments indicating potential console log outputs that are currently commented out.

Uploaded by

cihos45202
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

const name = "hitesh"

const repoCount = 50

// console.log(name + repoCount + " Value");

console.log(`Hello my name is ${name} and my repo count is ${repoCount}`);

const gameName = new String('hitesh-hc-com')

// console.log(gameName[0]);
// console.log(gameName.__proto__);

// console.log(gameName.length);
// console.log(gameName.toUpperCase());
console.log(gameName.charAt(2));
console.log(gameName.indexOf('t'));

const newString = gameName.substring(0, 4)


console.log(newString);

const anotherString = gameName.slice(-8, 4)


console.log(anotherString);

const newStringOne = " hitesh "


console.log(newStringOne);
console.log(newStringOne.trim());

const url = "https://hitesh.com/hitesh%20choudhary"

console.log(url.replace('%20', '-'))

console.log(url.includes('sundar'))

console.log(gameName.split('-'));

You might also like