Contact: aviboots(AT)netvision.net.il
38,255 questions
49,893 answers
573 users
import Foundation var byteArray: [UInt8] = [1, 2, 3, 0, 0, 0, 0] // Remove trailing zeros while byteArray.last == 0 { byteArray.removeLast() } print(byteArray) /* run: [1, 2, 3] */