Convert a string to uppercase in Julia – uppercase() and uppercasefirst() Methods
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:
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:
println(uppercasefirst( "gfg" ))
println(uppercasefirst( "geeks" ))
println(uppercasefirst( "geeksforgeeks" ))
|
Output:
Last Updated :
01 Apr, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...