Sitemap
Akbor Hossain Rifat

Akbor Hossain Rifat

Hi There, MERN-Stack ,JavaScript ,TypeScript , React.js , Node.js , MongoDB , MySQL , WordPress Developer. Simplifying fullStack development for you.

10 Important string methods of Javascript

Press enter or click to view image in full size
  1. charAt(): The charAt() method returns the character at the specific index in the string.
Press enter or click to view image in full size

2. concat(): The concat() method used because joins two or more string.

3. lastIndexOf() : The lastIndexOf() method returns the position of the last fact of a specified value in a string.

Press enter or click to view image in full size

4. slice(): The slice() method on the string takes out a part and Let’s return a new part without changing.

Press enter or click to view image in full size

5. split(): The splice() method The split() method is used to split a string into an array of substrings and returns the new array.

Press enter or click to view image in full size

Get Akbor Hossain Rifat’s stories in your inbox

Join Medium for free to get updates from this writer.

6. substr(): The substr() method returns the length of a stretched string for a given number of characters starting from the specified position.

Press enter or click to view image in full size

7. trim(): The trim() method removes whitespace from both ends of a string.

Press enter or click to view image in full size

8. trimStart: The trim() method removes whitespace from the start of a string.

Press enter or click to view image in full size

9. trimEnd: The trimEnd() method removes whitespace from the end of a string.

Press enter or click to view image in full size

10. startsWith: The startsWith() method determines whether a string begins with the characters of a specified string. This method is used to verify it. Its return true or false.But remember startsWith() method case sensitive.

Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size

--

--

Akbor Hossain Rifat
Akbor Hossain Rifat

Written by Akbor Hossain Rifat

Hi There, MERN-Stack ,JavaScript ,TypeScript , React.js , Node.js , MongoDB , MySQL , WordPress Developer. Simplifying fullStack development for you.