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
<script>
var str = "Geeksforgeeks - Best Platform" ;
var newstr = str.toUpperCase()
console.log(newstr);
</script>
|
Output:
GEEKSFORGEEKS - BEST PLATFORM
Example 2:
JavaScript
<script>
var str = "TypeScript - String toUpperCase()" ;
var newstr = str.toUpperCase()
console.log(newstr);
</script>
|
Output:
TYPESCRIPT - STRING TOUPPERCASE()
Share your thoughts in the comments
Please Login to comment...