-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstrings-basics.js
More file actions
28 lines (22 loc) · 813 Bytes
/
strings-basics.js
File metadata and controls
28 lines (22 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const message = 'Hello Javascript Students'
const msgToLowerCase = message.toLowerCase()
const msgToUpperCase = message.toUpperCase()
const messageNoSpace = message.trim()
const newMessage = message.replace('Students', 'Engineers')
const withSubString = message.substring(9, 14);
const withStartWith = message.startsWith('Hello');
const withEndWith = message.endsWith('Students');
console.log(message);
console.log(msgToLowerCase);
console.log(msgToUpperCase);
console.log(messageNoSpace);
console.log(newMessage);
console.log(withSubString);
console.log(withStartWith);
console.log(withEndWith);
const mySchool = 'Boca Code';
const myIndex = mySchool.indexOf('Code')
console.log(myIndex);
const myString = 'Hello-level-up-students!';
const newString = myString.split('-');
console.log(newString.reverse);