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
JavaScript string match() method is used to match the string against a regular expression. This method method returns an array with the matches and null… Read More »JavaScript string match() | Method
JavaScript string search() method is used to search for a specific string or regular expression. This method accepts a regular expression and returns the index… 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 JavaScript string is an object that represents a sequence of characters. JavaScript strings have methods and properties because JavaScript treats primitive values… 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 replace() method to remove specific character from string JavaScript. This method searches a string for a value or a regular expression and returns a… Read More »Remove specific character from string JavaScript | Code
JavaScript string are immutable objects means once a String object is assigned to String reference the object value cannot be changed. You can’t change a… Read More »JavaScript string immutable | Basics
JavaScript strings are immutable, it can’t in-place remove characters from it but can carte new string with changes. There are 2 ways to remove the… Read More »Remove the first character from the string JavaScript | Code