If you come from C, C++ background that you must be familiar with print and println statements.
print() function :
print function is used to output text onto the screen/console.
//
// main.swift
// Swift Tutorials 2014-15
//
// Created by Code2care on 15/09/14.
// Copyright (c) 2014 Code2care. All rights reserved.
//
print("Hello! ")
print("We are learning Swift Programming Language!")
Output :
Hello! We are learning Swift
Program ended with exit code: 0
println() function :
println function is just same as that to print() except that each println outputs it contents to a newline.
//
// main.swift
// Swift Tutorials 2014-15
//
// Created by Code2care on 15/09/14.
// Copyright (c) 2014 Code2care. All rights reserved.
//
println("Hello!")
println("We are learning Swift Programming Language!")
Output :
Hello!
We are learning Swift
Program ended with exit code: 0
Note : We do not need to add a semi-colon to the end of each line as in most of the programming languages.
Note : No imports are needed of print and println statements.