(VB.NET) Transition from Crypt2.DecodeString to StringBuilder.Decode
Provides instructions for replacing deprecated DecodeString method calls with StringBuilder.Decode. Note: This example requires Chilkat v11.0.0 or greater.
Dim crypt2 As New Chilkat.Crypt2
' ...
' ...
' ------------------------------------------------------------------------
' The DecodeString method is deprecated:
' The string "Hello World" in base64 (using the utf-8 byte representation) is "SGVsbG8gV29ybGQ="
Dim encodedStr As String = "SGVsbG8gV29ybGQ="
Dim encoding As String = "base64"
Dim charset As String = "utf-8"
Dim str As String = crypt2.DecodeString(encodedStr,charset,encoding)
Debug.WriteLine(str)
' Output is "Hello World"
' ------------------------------------------------------------------------
' Do the equivalent using StringBuilder.Decode.
Dim sb As New Chilkat.StringBuilder
sb.Append(encodedStr)
sb.Decode(encoding,charset)
Debug.WriteLine(sb.GetAsString())
' Output is "Hello World"
|