1. What is a JavaScript String?
- JavaScript strings are for storing and manipulating text.
-A JavaScript string is zero or more characters written inside quotes.
β‘οΈExample:-
2. JavaScript Methods and Properties.
2.1. String length
To find the length of a string, use the built-in length property:
Example:-
2.2. slice() :-
-slice() extracts a part of a string and returns the extracted part in a new string.
-The method takes 2 parameters: the start position, and the end position (end not included).
-JavaScript counts positions from zero.
First position is 0.
Second position is 1.
2.3. substring():-
substring() is similar to slice().
The difference is that substring() cannot accept negative indexes.
Example:
2.4. substr();
substr() is similar to slice().
The difference is that the second parameter specifies the length of the extracted part.
Example:
2.5. Replacing String Content;-
The replace() method replaces a specified value with another value in a string:
Example:-
-This method does not change the string it is called on.
-It returns a new string.
-It replaces only the first match
-it is case sensitive.
2.6. toLowerCase():-
A string is converted to lower case with toLowerCase().
Example:-
2.7. toUpperCase();-
A string is converted to Upper case with toUpperCase().
Example:-
2.8. concat();-
concat() joins two or more strings.
Example;-
2.9, String trim():-
The trim() method removes whitespace from both sides of a string:
Example:-
3. String Padding:-
ECMAScript 2017 added two String methods: padStart and padEnd to support padding at the beginning and at the end of a string.
10.1. padStart():-
This Method will start giving padding from the start.
10.2. padEnd():-
This Method will start giving padding from the End.
Example:-
4. Extracting String Characters
There are 3 methods for extracting string characters:
4.1. charAt(position):-
The charAt() method returns the character at a specified index (position) in a string:
Example:-
4.2. charCodeAt(position):-
String charCodeAt()
The charCodeAt() method returns the unicode of the character at a specified index in a string:
The method returns a UTF-16 code (an integer between 0 and 65535).
HERE ARE 10 AI APPS YOU NEED TO HAVE ON YOUR MOBILE
1. Heardly
β Save time with 8-min audio book summaries.
β Heardly APP compresses bestsellers to 10%, offering 8-minute audio and video summaries with AI, saving your reading time everyday.
2. Otter / @otter_ai
β OtterPilotβ’ enables AI-powered meetings. Get a meeting assistant that can record audio, take notes, automatically collect slides, and provide summaries.
12 remote jobs paying $80/hr, No Resume No Experience required
1. Gaggle:
β Gaggle hires content reviewers to monitor online student activities and promote kid safety.
β Pay ranges from $20 to $25 per hour.
β Work include identifying potential challenges in K-12 student communications. Flexible scheduling with a minimum of 10 hours each week. Basic technological knowledge and an interest in kid safety are necessary.
2. Preply:
β Preply is an online tutoring company that provides possibilities in more than 100 courses.
β Set your own rates, with potential revenues of more than $40 per hour.
β There is no need for specific qualification; simply be knowledgeable about your field. Create your profile, set your schedule, and begin tutoring in as few as 5 days.