FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaScriptNote/basic/string.js at master · mbrsagor/JavaScriptNote · GitHub
mbrsagor
/
JavaScriptNote
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
5
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaScriptNote
/
basic
/
string.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
58 lines (41 loc) · 1.27 KB
Breadcrumbs
JavaScriptNote
/
basic
/
string.js
Copy path
File metadata and controls
58 lines (41 loc) · 1.27 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
const
text
=
'I love React and Angular.JS'
;
console
.
log
(
text
)
;
console
.
log
(
text
.
replace
(
'React'
,
'React.JS'
)
)
;
// Example 2
const
str
=
'JS will, JS will rock you!'
;
console
.
log
(
str
)
;
const
newStr
=
str
.
replace
(
/
J
S
/
g
,
'JavaScript'
)
;
console
.
log
(
newStr
)
;
var
address
=
"Dhormopur, Sundorgonj, Gaibandha"
;
console
.
log
(
address
)
;
let
name
=
"Mbr-Sagor"
;
console
.
log
(
name
)
;
const
username
=
"Sagor"
;
console
.
log
(
username
)
;
// let language ="Bozlur ";
// let middle_name = "Rosid ";
// let last_name ="Sagor";
// console.log(language, middle_name, last_name);
let
[
first_name
,
middle_name
,
last_name
]
=
[
"Bozlur"
,
"Rosid"
,
"Sagor"
]
;
console
.
log
(
first_name
,
middle_name
,
last_name
)
;
var
page
=
window
.
open
(
'/path/to/pdf'
)
;
console
.
log
(
page
.
print
(
)
)
;
// String validation
var
myString
=
"An /invalid &string;"
;
var
charList
=
[
'/'
,
'\\'
,
'&'
,
';'
]
;
// etc...
function
sanitize
(
input
,
list
)
{
for
(
char
in
list
)
{
input
=
input
.
replace
(
char
,
''
)
;
}
return
input
}
let
san
=
sanitize
(
)
;
console
.
log
(
san
)
;
let
text2
=
"How are you doing today?"
;
const
myArray
=
text2
.
split
(
" "
)
;
let
word
=
myArray
[
1
]
;
console
.
log
(
word
)
;
// string format with variables
var
my_name
=
'John'
;
var
s
=
`hello
${
my_name
}
, how are you doing`
;
console
.
log
(
s
)
;
// prints hello John, how are you doing
Back
|
FazBrowse Home
|
New Git URL