Open In App

Convert a string to uppercase in Julia – uppercase() and uppercasefirst() Methods

Improve
Improve
Like Article
Like
Save
Share
Report

The uppercase() is an inbuilt function in julia which is used to return a string with all characters converted to uppercase.

Syntax: uppercase(s::AbstractString)

Parameters:

  • s::AbstractString: Specified string.

Returns: It returns a string with all characters converted to uppercase.

Example:




# Julia program to illustrate 
# the use of uppercase() method
   
# Getting a string with all 
# characters converted to uppercase
println(uppercase("gfg"))
println(uppercase("geeks"))
println(uppercase("geeksforgeeks"))


Output:

GFG
GEEKS
GEEKSFORGEEKS

uppercasefirst

The uppercasefirst() is an inbuilt function in julia which is used to return a string with first character converted to uppercase.

Syntax: uppercasefirst(s::AbstractString)

Parameters:

  • s::AbstractString: Specified string.

Returns: It returns a string with first character converted to uppercase.

Example:




# Julia program to illustrate 
# the use of uppercasefirst() method
   
# Getting a string with first
# character converted to uppercase
println(uppercasefirst("gfg"))
println(uppercasefirst("geeks"))
println(uppercasefirst("geeksforgeeks"))


Output:


Last Updated : 01 Apr, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads