How to print in the same line with Swift

1 Answer

0 votes
for index in 1...5 {
    print("\(index)", terminator: " ")
}





/*
run:
   
1 2 3 4 5 
  
*/

 



answered Feb 9, 2021 by avibootz
...