Sample code for 30+ languages & platforms
PowerShell

Load StringTable from a StringBuilder

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

Chilkat PowerShell Downloads

PowerShell
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"

$success = $false

$strTab = New-Object Chilkat.StringTable
$sb = New-Object Chilkat.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)

$i = 0
$numStrings = $strTab.Count
while ($i -lt $numStrings) {
    $([string]$i + ": " + $strTab.StringAt($i))
    $i = $i + 1
}