Swift - Introduction Printing Value

Introduction

You can print the current values of variables or constants using the print() or print() function.

The print() function prints out the value.

The print() function does the same and prints a line break.

The following statements print out the value of strMyAge :

Demo

let myAge = 10
var strMyAge = "My age is " + String (myAge)
print(strMyAge)

Result

Related Topic