Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js replace greek accents

normal = 'Αντίθετα με αυτό που θεωρεί η πλειοψηφία, το Lorem Ipsum δεν είναι απλά ένα τυχαίο κείμενο. Οι ρίζες του βρίσκονται σε ένα κείμενο Λατινικής λογοτεχνίας του 45 π.Χ., φτάνοντας την ηλικία του πάνω από 2000 έτη.';

pol = 'Μήγαρις ἔχω ἄλλο στὸ νοῦ μου πάρεξ ἐλευθερία καὶ γλώσσα;';

console.log(normalizeGreek(normal));
console.log(normalizePolytonicGreek(pol));

function normalizeGreek(text) {
    return text.normalize('NFD').replace(/[u0300-u036f]/g, "");
}


function normalizePolytonicGreek(text) {
    return text.normalize('NFD').replace(/[u0300-u036f]/g, "");
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to change input value in javascript using class 
Javascript :: javascript remove last charter stings 
Javascript :: how to use mongoose-encryption 
Javascript :: how to get java model attributes from javascript 
Javascript :: ios/main.jsbundle no such file or directory react native 
Javascript :: cheat sheet javascript 
Javascript :: group by in javascript 
Javascript :: what is react 
Javascript :: validation in react native 
Javascript :: Ternary Operator react 3 Conditions 
Javascript :: jquery if else 
Javascript :: rethrow error javascript 
Javascript :: get image from s3 bucket javascript 
Javascript :: Conditionally pass props to react component 
Javascript :: User Input from Javascript Console 
Javascript :: shorthand if statement js 
Javascript :: how to check the number is palindrome or not 
Javascript :: DevDependencies and dependencies syntax in Node package.json 
Javascript :: javascript datatypes 
Javascript :: reduce to calculate sum react 
Javascript :: timestamp to date 
Javascript :: add a socket to a room in socket.io 
Javascript :: datatable change classname by value 
Javascript :: jquery clear text in div 
Javascript :: javascript add 1 to each element in array 
Javascript :: javascript encryption decryption 
Javascript :: mongodb node js 
Javascript :: ejemplo archivo json 
Javascript :: how to remove last element from array in javascript 
Javascript :: array destructuring js 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =