-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString.js
More file actions
73 lines (63 loc) · 2.13 KB
/
Copy pathString.js
File metadata and controls
73 lines (63 loc) · 2.13 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
String:
*/
/*
Basic String:
const name = "arafat"
" Hello " + " World "
'Hello World'
*/
/*
const name = "arafat"
const repoCount = 50
console.log(name+repoCount+"value");
This are backdated...|
But Modern Days are:
console.log(`Hello my name is ${name} ,my repo is ${repoCount} `);
*/
/*
Some String Functions:
const gameName = new String("valueghflg-hhj")
console.log(gameName[0]);
console.log(gameName.__proto__); //double underscore { _ _ }
console.log(gameName.length);
console.log(gameName.toUpperCase());
console.log(gameName.charAt(2));
console.log(gameName.indexOf('u'));
console.log(gameName.indexOf("a"));
const newString = gameName.substring(0,6)
console.log(newString);
const anotherString = gameName.slice(-8,6)
console.log(anotherString);
const newStringone = " arafat "
console.log(newStringone);console.log(newStringone.trim());
// Know more about trim then :https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim
const url = "https://arafat.com/arafata%20yeash"
console.log(url.replace("%20","-"));
console.log(url.includes("yeash"));
console.log(url.includes('hitesh'));
const gameName1 = new String("valueghflg-hhj-ghfj")
console.log(gameName1.split("-"));
Please spending on string functions to read how to work on it ,so every string function has atleast few minutes to study on it below:~
Know more about trim then :
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split
*/
/*
If you want to learn about "string" :
"If you want to know about this string function{f},then go to click :
-->newTab-->inspect-->console-->[[Prototype]]: String."
length: 5
[[Prototype]]:
String anchor: ƒ anchor()
at: ƒ at()
big: ƒ big()
blink: ƒ blink()
bold: ƒ bold()
charAt: ƒ charAt()
charCodeAt: ƒ charCodeAt()
...... {... More ...}
Symbol(Symbol.iterator): ƒ [Symbol.iterator]()[[Prototype]]: Object[[PrimitiveValue]]: ""[[PrimitiveValue]]: "value"
*/
/*
+++++++++++++++++++++++++++++++++++ X +++++++++++++++++++++++++++++++++++++++++
*/