Swift String lowercased()

The lowercased() method converts all uppercase characters in a string into lowercase characters.

Example


lowercased() Syntax

The syntax of lowercased() method is:

string.lowercased()

Here, string is an object of the String class.


lowercased() Parameters

lowercased() method doesn't take any parameters.


lowercased() Return Value

returns the given string in lowercase


Example 1: Swift lowercased()

Output

this should be lowercase!
th!s sh0uld b3 upp3rcas3!

Example 2: Compare Two Strings Using lowercased()

Output

The strings are same.