Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

dart
string
communitycreator

What is toLowerCase() in Dart?

Harris Amjad

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.

The toLowerCase() function converts a string to lowercase. The following figure shows a visual representation of the toLowerCase() function.

Figure 1: Visual representation of toLowerCase() function

Syntax

The prototype of the toLowerCase() function is as follows:

string_name.toLowerCase()

string_name is the name of the string variable that is to be converted to lowercase.

Parameter

The toLowerCase() function does not require a parameter.

Return value

The toLowerCase() function returns the specified string converted to lowercase.

Code

The following code shows how to use toLowerCase() in Dart.

import 'dart:convert';
void main() {
//string
print("('EDUCATIVE').toLowerCase(): ${("EDUCATIVE").toLowerCase()}");
//string with number
print("('EDUCATIVE09').toLowerCase(): ${("EDUCATIVE09").toLowerCase()}");
}

All characters (A-Z) in the strings are converted to their lowercase counterparts in the code above.

RELATED TAGS

dart
string
communitycreator

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