Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 368 Bytes

README.md

File metadata and controls

19 lines (14 loc) · 368 Bytes

fixed-width-decoder

fixed width string reading library written in Swift.

Usage for reading fixed width strings

From string

import FW

let fwString = "  1foo\n  2bar\n"
let reader = try! FWReader(string: fwString, rowWidth: 7, fieldSizes: [3, 3])
while let row = reader.next() {
    print("\(row)")
}
// => ["  1", "foo"]
// => ["  2", "bar"]