Skip to content
Related Articles

Related Articles

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

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

Syntax: lowercase(s::AbstractString)

Parameters:

  • s::AbstractString: Specified string.

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

Example:






# Julia program to illustrate 
# the use of lowercase() method
   
# Getting a string with all 
# characters converted to lowercase
println(lowercase("GFG"))
println(lowercase("GEEKS"))
println(lowercase("GEEKSFORGEEKS"))

Output:

gfg
geeks
geeksforgeeks

lowercasefirst

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

Syntax: lowercasefirst(s::AbstractString)

Parameters:

  • s::AbstractString: Specified string.

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

Example:




# Julia program to illustrate 
# the use of lowercasefirst() method
   
# Getting a string with first
# character converted to lowercase
println(lowercasefirst("GFG"))
println(lowercasefirst("GEEKS"))
println(lowercasefirst("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 :