Javascript String toLocaleUpperCase()

Introduction

Javascript String toLocaleLowerCase() converts string to upper case according to current locale.

str.toLocaleUpperCase()
str.toLocaleUpperCase(locale) 
str.toLocaleUpperCase([locale, locale, ...])
  • locale - Optional, locale to be used

The converted string is returned from the method and leaves the original string unchanged.

let stringValue = "hello WORLD"; 
let a = stringValue.toLocaleUpperCase();
console.log(a);  // "HELLO WORLD" 
console.log(stringValue);/*  ww w. java  2  s .co  m*/



PreviousNext

Related