str_to_title()
Function in R Language is used to convert the first letter of every word of a string to Uppercase and the rest of the letters are converted to lower case.
Note: This function uses 'stringr' library.
Syntax: str_to_title(string)
Parameter:
string: string to be converted
Example 1:
# R Program to illustrate # the use of str_to_title function # Loading Library library(stringr) # Creating a string str <- "geeks for geeks" # Calling str_to_title() function str_to_title(str)
Output:
[1] "Geeks For Geeks"
Example 2:
# R Program to illustrate # the use of str_to_title function # Loading Library library(stringr) # Creating a string str <- "GEEKS FOR GEEKS" # Calling str_to_title() function str_to_title(str)
Output:
[1] "Geeks For Geeks"
Australia
UK
UAE
Singapore
Canada
New
Zealand
Malaysia
USA
India
South
Africa
Ireland
Saudi
Arab
Qatar
Kuwait
Hongkong
Copyright 2016-2023 www.programmingshark.com - All Rights Reserved.
Disclaimer : Any type of help and guidance service given by us is just for reference purpose. We never ask any of our clients to submit our solution guide as it is, anywhere.