Swift - Data Type String case

Introduction

Consider the following statement:

Demo

var str1 = "This is a Swift string"
print(str1.uppercaseString)/*ww w. j  a  va2 s .  c o m*/
print(str1.lowercaseString)
print(str1.capitalizedString)

Based on type inference, str1 would be of String type.

Related Topic