Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

typescript
string
lowercase
communitycreator

What is the toLowercase() method of a string in TypeScript?

Theodore Kelechukwu Onyejiaku

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Overview

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.

Syntax

string.toLowerCase()
Syntax for leftTrim() method in TypeScript

Parameters

string: This is the string we want to convert to uppercase.

Return value

This method returns the lowercase equivalent of the string string.

Example

export {}

// create some strings.
let name:string = "TheoDORE"
let role:string = "SOFTWARE DEVELOPER"
let nickName:string = "KCEE"
let hubby:string = "CoDIng"

// convert to uppercase
console.log(name.toLowerCase())
console.log(role.toLowerCase())
console.log(nickName.toLowerCase())
console.log(hubby.toLowerCase())
Get the lowercase eqivalent of a string in TypeScript

Explanation

  • Line 1: We export our file as a module.
  • Lines 4–7: We create some strings.
  • Lines 10–13: We use the tolowerCase() method to get the uppercase versions of our strings and print them to the console.

RELATED TAGS

typescript
string
lowercase
communitycreator

CONTRIBUTOR

Theodore Kelechukwu Onyejiaku

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring