JavaScript | string.normalize()
The string.normalize() is an inbuilt function in javascript which is used to return a Unicode normalisation form of a given input string. If the given input is not a string, then at first it will be converted into string then this function will work.
Syntax:
string.normalize([form])
Parameters: Here the parameter is form which is of many types-
These all says the Unicode Normalization Form.
Return value: It returns a new string containing the Unicode Normalization Form of the given input string.
<script> // Taking a string as input. var a = "GeeksForGeeks"; // calling normalize function. b = a.normalize('NFC') c = a.normalize('NFD') d = a.normalize('NFKC') e = a.normalize('NFKD') // Printing normalised form. document.write(b +"<br>"); document.write(c +"<br>"); document.write(d +"<br>"); document.write(e); </script> |
Output:
GeeksForGeeks GeeksForGeeks GeeksForGeeks GeeksForGeeks
Reference:
http://devdocs.io/javascript/global_objects/string/normalize
Recommended Posts:
- Introduction to JavaScript Course | Learn how to Build a task tracker using JavaScript
- JavaScript Course | Understanding Code Structure in JavaScript
- JavaScript Course | Logical Operators in JavaScript
- JavaScript Course | Conditional Operator in JavaScript
- JavaScript Course | Data Types in JavaScript
- JavaScript Course | Printing Hello World in JavaScript
- JavaScript Course | Loops in JavaScript
- JavaScript Course | Functions in JavaScript
- JavaScript Course | JavaScript Prompt Example
- JavaScript Course | Variables in JavaScript
- JavaScript Course | Objects in JavaScript
- JavaScript Course | Operators in JavaScript
- JavaScript vs Python : Can Python Overtop JavaScript by 2020?
- How to include a JavaScript file in another JavaScript file ?
- this in JavaScript
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



