Ritika

Difference between slice() and substring() in javascript

The two popular methods of javascript strings slice() and substring() are very similar, but there are a few differences. This article discusses the differences between the slice() and substring() methods using various scenarios and example illustrations. Let’s start looking into the syntax of both: syntax of slice():- Here, The indexes of the slice() method are zero-based. The startIndex specifies from […]

Difference between slice() and substring() in javascript Read More »

Remove leading and trailing spaces : Javascript String

Often there is a requirement to remove leading and trailing spaces while working with javascript strings. This article will discuss removing the spaces from the start and end of a string in javascript using simple methods and illustrative examples. Table of Contents:- Javascript remove leading and trailing spaces from a string using RegEx() Javascript remove

Remove leading and trailing spaces : Javascript String Read More »

Javascript: Remove backslash escaping

This article will discuss removing backslash escape character from a javascript string using simple methods and example illustrations. Table of Contents:- Javascript remove escape character from a string using replace() Javascript remove escape character from a string using replaceAll() Javascript remove escape character from a string using split() and join() Javascript remove backslash escape from

Javascript: Remove backslash escaping Read More »

Javascript: 4 ways to do case-insensitive comparison

A general requirement while working in javascript is case-insensitive string comparisons. Case-insensitive comparison means equating strings irrespective of their case. It does not matter if the string is in upper-case or lower-case. We need to equate them and check if they are the same. While there are multiple ways to perform this job, each technique

Javascript: 4 ways to do case-insensitive comparison Read More »

Javascript: Remove everything after a certain character

At times we need to do certain operations on strings while working in javascript, and one such requirement is to remove everything after a specific character in a string. Table of Contents:- Javascript remove everything after a certain character using split() Javascript remove everything after a certain character using substring() Javascript remove everything after a

Javascript: Remove everything after a certain character Read More »

Scroll to Top