(Java) Load StringTable from a StringBuilder
Demonstrates how to load a StringTable from the text contained in a Chilkat StringBuilder object.
import com.chilkatsoft.*;
public class ChilkatExample {
static {
try {
System.loadLibrary("chilkat");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}
public static void main(String argv[])
{
CkStringTable strTab = new CkStringTable();
CkStringBuilder sb = new CkStringBuilder();
boolean success;
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.get_Count();
while (i < numStrings) {
System.out.println(i + ": " + strTab.stringAt(i));
i = i+1;
}
}
}
|