-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathString.js
42 lines (28 loc) · 1.14 KB
/
String.js
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const name= "asbhishek"
const repocount= 30
// **** STRING DECLEARATION ****
// console.log(name+repocount+"value");
// backtick
// console.log(`hello my name i ${name} and my repo is ${repocount}`);
// uper syntax is mordern way to write by this we can also apply any function on variable like name.Touppercase
const myname = new String('abhishek'); //if we are using new keyword by this we can use objects of javascript
// console.log(myname[0]); // we can access word in any string
// we can use prototype by put a dot
let othername=myname.toUpperCase()
// console.log(myname.replace("a","j"))
// console.log(myname.indexOf("s"))
// console.log(myname);
// console.log(othername);
// here not changing original string
const mynamew= myname.substring(0,3)
// console.log(mynamew);
const newname=" ashish "
const changename=newname.big()
console.log(changename);
// console.log(newname.trim()) //will cut unwanted spaces,white spaces
// console.log(newname)
let url="https://abhisehek.com/abhishek/fis o73 4*&^"
// console.log(url);
// console.log(url.replace(/\s+/g, ' ').trim());
// console.log(url.includes("abhiek"))
// console.log(mynamew)