-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString.js
More file actions
89 lines (77 loc) · 1.8 KB
/
String.js
File metadata and controls
89 lines (77 loc) · 1.8 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
console.log("There Are Two Way To Create A String ")
//1 St Method(Using Double coat)
let str="Java Script"
//2 nd Method(Using Single coat)
let str1="Java Script 2nd"
console.log(str)
console.log(str1)
console.log(str.length)
console.log(str1.length)
console.log(str[0])
console.log(str[1])
console.log(str[2])
console.log(str[3])
*/
/*
let obj={
name:"Pen",
price:10,
};
console.log("Without Using Templete Literals-------The Cost Of ",obj.name,"is",obj.price,"rupees")
console.log("With Using Templete Literals-------")
let output=`The Cost Of ${obj.name} is ${obj.price} rupees`
console.log(output)
*/
/*
let str="Apna\tCollege"
console.log(str.length)
*/
/*
let str="javascript"
let newstring=str.toUpperCase()
console.log("Old String : ",str)
console.log("New String : ",newstring)
*/
/*
let str="JAVASCRIPT"
str=str.toLowerCase()
let newstring=str.toLowerCase()
console.log("Original Content Changed of Old String : ",str)
console.log("New String : ",newstring)
*/
/*
let str=" JAVASCRIPT "
let newstring=str.trim()
console.log(" Old String : ",str)
console.log("New String : ",newstring)
*/
/*
let str="abcdefg"
let newstring=str.slice(1,3)
console.log(str)
console.log(newstring)
*/
/*
let str1="ab"
let str2="cd"
let newstring=str1.concat(str2)
console.log("String 1",str1)
console.log("String 2",str2)
console.log("After Concatenation : ",newstring)
*/
/*
let str="My Name Is xxxx"
let newstring=str.replace("xxxx","Rahul")
console.log("My Demo Name : ",str)
console.log("My Name Is : ",newstring)
*/
let uFname=prompt("Enter Your Full Name : ")
let uName="@"+uFname+uFname.length
console.log(uName)
/*
let len=uFname.length
let at="@"
let userName=at.concat(uFname)+len
console.log(userName)
*/