JavaScript string object toUpperCase method entry instance (for converting letters toUpperCase)
- 2020-03-30 04:09:26
- OfStack
JavaScript method toUpperCase
The toUpperCase method is used to convert (English) strings toUpperCase and return the converted string. The syntax is as follows:
str_object.toUpperCase()
Instance of the toUpperCase method
<script language="JavaScript">
var str = "AaBbCc";
document.write( str.toUpperCase() );
</script>
Run the example and output:
AABBCC
ToLocaleUpperCase method
The toLocaleUpperCase method toUpperCase is essentially the same, and toLocaleUpperCase converts the string toUpperCase locally. Only a few languages, such as Turkish, have locally-specific case mappings.