Skip to content
Related Articles

Related Articles

TypeScript | String toUpperCase() Method
  • Last Updated : 18 Jun, 2020

The toUpperCase() is an inbuilt function in TypeScript which is used to convert the characters within a string to uppercase.

Syntax: 

string.toUpperCase( ) 

Parameter: This methods does not accept any parameter. 
Return Value: This method returns the string in uppercase. 
Below examples illustrate the String toUpperCase() method in TypeScript

Example 1: 

JavaScript



filter_none

edit
close

play_arrow

link
brightness_4
code

<script>
    // Original strings
    var str = "Geeksforgeeks - Best Platform"
  
    // use of String toUpperCase() Method
    var newstr = str.toUpperCase() 
    console.log(newstr);
</script>

chevron_right


Output:

GEEKSFORGEEKS - BEST PLATFORM

Example 2: 

JavaScript

filter_none

edit
close

play_arrow

link
brightness_4
code

<script>
    // Original strings
    var str = "TypeScript - String toUpperCase()"
  
    // use of String toUpperCase() Method
    var newstr = str.toUpperCase() 
    console.log(newstr);
</script>

chevron_right


Output: 

TYPESCRIPT - STRING TOUPPERCASE()

full-stack-img

My Personal Notes arrow_drop_up
Recommended Articles
Page :