Sample code for 30+ languages & platforms
Swift

Load StringTable from a StringBuilder

Demonstrates how to load a StringTable from the text contained in a Chilkat StringBuilder object.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let strTab = CkoStringTable()!
    let sb = CkoStringBuilder()!

    sb.append(value: "This is line 1\r\n")
    sb.append(value: "An empty line follows...\r\n")
    sb.append(value: "\r\n")
    sb.append(value: "This is line 4\r\n")

    strTab.append(fromSb: sb)

    var i: Int = 0
    var numStrings: Int = strTab.count.intValue
    while i < numStrings {
        print("\(i): \(strTab.string(at: i)!)")
        i = i + 1
    }


}