We can get the lowercase representation of a string in TypeScript by using the toLowerCase()
method. This method is available in JavaScript as well.
Note: This method does not permanently modify the string.
string.toLowerCase()
string
: This is the string we want to convert to uppercase.
This method returns the lowercase equivalent of the string string
.
export {}// create some strings.let name:string = "TheoDORE"let role:string = "SOFTWARE DEVELOPER"let nickName:string = "KCEE"let hubby:string = "CoDIng"// convert to uppercaseconsole.log(name.toLowerCase())console.log(role.toLowerCase())console.log(nickName.toLowerCase())console.log(hubby.toLowerCase())
tolowerCase()
method to get the uppercase versions of our strings and print them to the console.