JavaScript lastIndexOf() | String method
JavaScript lastIndexOf() string method is used to get the last occurrence of a substring in a string. It searches the position of a particular character… Read More »JavaScript lastIndexOf() | String method
JavaScript lastIndexOf() string method is used to get the last occurrence of a substring in a string. It searches the position of a particular character… Read More »JavaScript lastIndexOf() | String method
The JavaScript string match() method matches the string against a regular expression. This method returns an array with the matches and null if no match… Read More »JavaScript string match() | Method
The javaScript string search() method searches for a specific string or regular expression. This method accepts a regular expression and returns the index of the… Read More »JavaScript string search() | Method
JavaScript valueOf() String method is used to get the primitive value of the string object. You don’t need to use it in your code because… Read More »JavaScript valueOf() | String method
As you know a JavaScript string is an object that represents a sequence of characters. JavaScript strings have methods and properties because JavaScript treats primitive… Read More »JavaScript string methods | Code
To get the last N or 4 characters of a string, use the slice method on the string in JavaScript. You have to pass the… Read More »Get last 4 characters of string JavaScript | Example code
Use charAt() method to get the last character of the string in JavaScript. The first character in the string has an index of 0, so… Read More »Get last character of string JavaScript | Example code
Use the replace() method to remove specific characters from string JavaScript. This method searches a string for a value or a regular expression and returns… Read More »Remove specific character from string JavaScript | Code
JavaScript strings are immutable objects means once a String object is assigned to a String reference the object value cannot be changed. You can’t change… Read More »JavaScript string immutable | Basics
JavaScript strings are immutable, it can’t remove characters from them but can carte new strings with changes. There are 2 ways to remove the first… Read More »Remove the first character from the string JavaScript | Code