Sample code for 30+ languages & platforms
VBScript

StringBuilder GetEncoded

Demonstrates the Chilkat StringBuilder GetEncoded method.

Chilkat VBScript Downloads

VBScript
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)

s = "The quick brown fox jumps over the lazy dog"

set sb = CreateObject("Chilkat.StringBuilder")

success = sb.Append(s)

' output: The quick brown fox jumps over the lazy dog
outFile.WriteLine(sb.GetAsString())

' Get the string encoded to base64, without changing the contents of sb.
' output: VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw==
outFile.WriteLine(sb.GetEncoded("base64","utf-8"))

' The contents of sb are not changed..
' output: The quick brown fox jumps over the lazy dog
outFile.WriteLine(sb.GetAsString())

outFile.Close