Swift - Data Type String case

Introduction

Consider the following statement:

Demo

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

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

Related Topic