The string toUpperCase() method converts all characters of the string into an uppercase letter. The string toUpperCase() function returns the string after converting all characters of the string into the uppercase letter.
Syntax: Str.toUpperCase()
Parameter: The string toUpperCase() function doesn’t accept any parameter.
Return Value: The string toUpperCase() function returns the string after
converting all characters of the string into the uppercase letter.
Example1:
Dart
void main() {
String Str1 = "geeks" ;
String Str2 = "fOr GEeks" ;
print(Str1.toUpperCase());
print(Str2.toUpperCase());
}
|
Output:
GEEKS
FOR GEEKS
Example 2:
Dart
void main() {
String Str1 = "COMPUTER" ;
String Str2 = "laPToP" ;
print(Str1.toUpperCase());
print(Str2.toUpperCase());
}
|
Output:
COMPUTER
LAPTOP
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
14 Jul, 2020
Like Article
Save Article