Home » JavaScript Tutorial

String normalize() Method with Example in JavaScript

JavaScript String normalize() Method: Here, we are going to learn about the normalize() method of the string in JavaScript with Example.
Submitted by Shivang Yadav, on February 16, 2020

JavaScript | String normalize() Method

The String.normalize() method in JavaScript is used to find the Unicode normalized form of the string passed as a parameter to the function.

Syntax:

    String.normalize(str);

Parameter(s):

The method accepts only one parameter which indicates which type of normalization is to be found.

The following is the parameter list that shows different forms that are processed,

  • NFC : Normalization form Canonical composition
  • NFKC : Normalization form compatibility composition
  • NFD : Normalization form Canonical decomposition
  • NFKD : Normalization form compatibility decomposition

Return value:

The return type of this method is string which is Unicode normalization is to be found.

Browser support: Chrome, Internet explorer, Mozilla, Safari, Opera mini.

Example:

str = "Hello"
//"Hello"
str.normalize('NFC')
//"Hello"
str.normalize('NFD')
//"Hello"
str.normalize('NFKD')
//"Hello"
str.normalize('NFKC')
//"Hello"





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.