The localizedUppercase
property of a String
instance in Swift is used to get the uppercase version of a string that is produced using the current locale.
string.localizedUppercase
This property returns the uppercase representation of the String
instance string
.
Let’s look at the code below:
// import the foundation frameworkimport Foundation// create stringslet str1 = "Metamask"let str2 = "Solana"let str3 = "NFT"let str4 = "BlockCHAIN"let str5 = "Meta"// get the capitalized representationprint(str1.localizedUppercase)print(str2.localizedUppercase)print(str3.localizedUppercase)print(str4.localizedUppercase)print(str5.localizedUppercase)
Foundation
framework, which provides methods and functionalities such as the localizedUppercase
property.localizedUppercase
property and print the returned values to the console.