Found 448 Articles for Programming Scripts

For Hosts Locale how to convert a string to lowercase letters in JavaScript?

Lakshmi Srinivas
Updated on 23-Jun-2020 07:46:38

92 Views

To convert a string to lowercase letters in JavaScript, use the toLocaleLowerCase() method.ExampleYou can try to run the following code to learn how to work with toLocaleLowerCase() method in JavaScript −Live Demo                    var a = "WELCOME!";          document.write(a.toLocaleLowerCase());          

With JavaScript RegExp search a carriage return character.

Ayyan
Updated on 23-Jun-2020 07:45:25

497 Views

To find carriage return character with JavaScript Regular Expression, use the following −\rExampleYou can try to run the following code to find a carriage return character. It returns the position where the carriage return (\r) character is found −           JavaScript Regular Expression                        var myStr = "100% \r Responsive!";          var reg = /\r/;          var match = myStr.search(reg);                    document.write(match);          

With JavaScript Regular Expression find a non-whitespace character.

Daniol Thomas
Updated on 23-Jun-2020 07:49:31

276 Views

To find a non-whitespace character, use the following −\SExampleYou can try to run the following code to find non-whitespace character −        JavaScript Regular Expression                        var myStr = "100% Responsive!";          var reg = /\S/g;          var match = myStr.match(reg);                    document.write(match);          

How to convert Unicode values to characters in JavaScript?

Shubham Vora
Updated on 22-Aug-2022 08:51:03

5K+ Views

In this tutorial, we will learn to convert Unicode values to characters in JavaScript. The Unicode values are the standard values for the character, and users can encode them to convert them into characters. For example, ‘A’ is a Unicode character whose value is 65 according to the ASCII (American standard code for information interchange) table. In the same way, all alphabets, numbers, and other characters have particular Unicode values. We will learn to identify the Unicode character from its values using JavaScript. Using the fromCharCode() Method In JavaScript, the string library contains the fromCharCode() method, which takes the decimal ... Read More

With JavaScript RegExp search a vertical tab character.

Abhinaya
Updated on 23-Jun-2020 07:50:10

204 Views

To find a vertical tab character with JavaScript Regular Expression, use the following −\vExampleYou can try to run the following code to find a vertical tab character. It returns the position where the vertical tab (\v) character is found −           JavaScript Regular Expression                        var myStr = "Secure and \v Responsive!";          var reg = /\v/;          var match = myStr.search(reg);          document.write(match);          

How to check whether a value is a safe integer or not in JavaScript?

Shubham Vora
Updated on 08-Aug-2022 08:59:04

400 Views

In this tutorial, we will learn to check whether a value is a safe integer or not in JavaScript. The simple definition of the safe integer in JavaScript is all numbers we can represent under the IEEE-754 double-precision number. It is the set of all numbers which lie between the -(2^53) to (2^53) exclusive, and we can represent it in the standard way. Here, we have different approaches to checking whether the number is a safe integer. Using the Number.IsSafeInteger() Method Using the if-else Conditional Statement Using the Number.isSafeInteger() Method In JavaScript, the isSafeInteger() method checks that type ... Read More

Set the milliseconds for a specified date according to universal time.

Nishtha Thakur
Updated on 23-Jun-2020 07:38:52

133 Views

Javascript date setUTCMilliseconds() method sets the milliseconds for a specified date according to universal time.The following is the parameter for setUTCMilliseconds(millisecondsValue) −millisecondsValue − A number between 0 and 999, representing the milliseconds.ExampleYou can try to run the following code to set the milliseconds for a specified date according to universal time −           JavaScript setUTCMilliseconds Method                        var dt = new Date( "Aug 28, 2008 23:30:00" );          dt.setUTCMilliseconds( 1200 );                    document.write( dt );          

Find digit with JavaScript RegExp.

Sravani Alamanda
Updated on 26-Aug-2022 13:03:17

499 Views

In this tutorial, we will see how to find digits (0-9) using JavaScript RegExp. ASCII value for digits [0-9] starts from 48 to 57. If you want to print any ASCII value for a digit, 48 needs to be added to that digit. We denote digits as \d in the regular expression. A RegExp is an object that specifies the pattern used to do a search and replace operations on the string or for input validation. Syntax Following is the syntax for regular expression pattern of digit or \d character − new RegExp("\d") or simply /\d/ /\d/ is ... Read More

With JavaScript RegExp find a character except newline?

Anvi Jain
Updated on 23-Jun-2020 07:40:33

158 Views

To find a character except for a newline, use the Metacharacter. (period). You can try to run the following code to find a character −Example           JavaScript Regular Expression                        var myStr = "We provide websites! We provide content!";          var reg = /p.o/g;          var match = myStr.match(reg);                    document.write(match);          

How to write a JavaScript RegExp to match an expression?

Nikitha N
Updated on 23-Jun-2020 07:41:44

69 Views

To match an expression, use the JavaScript match() method. This method is used to retrieve the matches when matching a string against a regular expression. The following is the parameter −param − A regular expression object.If the regular expression does not include the g flag, it returns the same result as regexp.exec(string).If the regular expression includes the g flag, the method returns an Array containing all the matches.ExampleYou can try to run the following code to math an expression using JavaScript Regular Expression −           JavaScript String match() Method               ... Read More

Advertisements