Programare swift Swift tutorial from tutorials point | Page 22
Swift 4
Terminator – the value with which line should end, let’s see a example and syntax of same.
print(“Items to print”, separator: “Value ” , Terminator: “Value”)
// E.g. of print statement.
print(“Value one”)
// prints “Value one \n” Adds, \n as terminator and “ ” as separator by
default.
print(“Value one”,”Value two”, separator: “ Next Value” , terminator: “ End”)
//prints “Value one Next Value Value two End”
In the above code first print statement adds \n , newline Feed as terminator by default,
where as in second print statement we’ve given “ End ” as terminator, hence it’ll print “End
” instead of \n.
We can give our custom separator and terminators according to our requirement.
10