Sample code for 30+ languages & platforms
B4X

StringBuilder GetEncoded

Demonstrates the Chilkat StringBuilder GetEncoded method.

Chilkat B4X Downloads

B4X
Dim s As String = "The quick brown fox jumps over the lazy dog"

Dim sb As ChilkatStringBuilder
sb.Initialize

sb.Append(s)

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

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

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