Sample code for 30+ languages & platforms
Java

Load StringTable from a StringBuilder

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

Chilkat Java Downloads

Chilkat2 Java
import com.chilkatsoft.chilkat2.StringBuilder;
import com.chilkatsoft.chilkat2.StringTable;

public class ChilkatExample {

    public static void main(String[] args) {
        StringTable strTab = new StringTable();
        StringBuilder sb = new StringBuilder();

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

        strTab.appendFromSb(sb);

        int i = 0;
        int numStrings = strTab.getCount();
        while (i < numStrings) {
            System.out.println(i + ": " + strTab.stringAt(i));
            i = i + 1;
        }
    }
}