Skip to content
Related Articles

Related Articles

Convert a string to uppercase in Julia – uppercase() and uppercasefirst() Methods
  • Last Updated : 01 Apr, 2020

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:

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :