-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring-method-functions.js
More file actions
79 lines (56 loc) · 3.22 KB
/
string-method-functions.js
File metadata and controls
79 lines (56 loc) · 3.22 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
//sting function use basicly esy access and modifiy array
//List of sting function/method
var a = "Javascript a good and greate language ";
//1. lenght(): Used for count keyword/char with space used this
//console.log(a.length);
//2. toLowerCase(); used for all charter have samller display
//console.log(a.toLowerCase());
//3. toUpperCase(): used for all chartter have capital diplay
//console.log(a.toUpperCase());
//4. includes(): used for search a keyword in string and return true/false and this is case sanstive function
//console.log(a.includes('good'));
//5. startstWith(): used for search a start keyword/sting in string and return true/false and this is case sanstive function
//console.log(a.startsWith('Java'));
//6. endsWith(): used for search a end keyword/sting in string and return true/false and this is case sanstive function
//console.log(a.endsWith('language'));
//7. search(): used for search a keyword in string and return a sting postion(index) and this is case sanstive function
//console.log(a.search('language'));
//8. match(): used for search a keyword in string and return a array with value and this is case sanstive function
//console.log(a.match('language'));
//9. indexOf(): used for search in starting of array a keyword in string and return a index postion and this is case sanstive function
//console.log(a.indexOf('good'));
//10. lastIndexOf(): used for search in last of array a keyword in string and return a index postion end side and this is case sanstive function
//console.log(a.lastIndexOf('language'));
//11. replace(): used for replace or chnage a exits word this is case sanstive
//console.log(a.replace('language', 'programming language'));
//12. trim(): used for reomve extra spaces in string
// var b = "a javascript b";
// var d = b.trim();
//console.log(b);
//13. charAt(): used for return a charter for difine index
//console.log(a.charAt(3));
//14. charCodeAt(): used for return a charter Sky code value
//console.log(a.charCodeAt(2));
//15. fromCharCode(): used for return a charter Sky char value
//console.log(String.fromCharCode(97));
//16. concat(): used for multiple string add in single string and used multiple var
// var b = " Good Knwolge";
// console.log(a.concat(b));
// var c = " Lorem Ispum";
// console.log(a.concat(b , c));
//17. split(): Used for string convert to array every single word. Difine a which symbol to convert array
//console.log(a.split(" "));
//18. repeat(): Used for repeat a string difine a number then repeat string
//console.log(a.repeat(5));
//19. slice(): Used for get a particuller word used this dine a sting start and end index if you send sting postion -1,-2 then will return in last chart to start char
//console.log(a.slice(10, 20));
//20. substr(): Used for get a srting for start key number and end key number
//console.log(a.substr(5, 15));
//21. substring(): Used for get a srting for start key number and end key number. but they have no return last number of value he just return second last char
//console.log(a.substring(5, 15));
//22. toString(): Used for any type of value convert to string
//var d=[10, "hello Workd", true];
//console.log(d.toString());
//23. valueOf(): Used for same value return for string
//var b = [10, 20];
//console.log(a.valueOf());