base64Decode()
The strlib.base64Decode() returns the BASE64 decoded value of the input string.
To Encode, use the strLib.base64Encode() strLib.base64Encode() function instead.
Syntax
strLib.base64Decode(text STRING? in)
returns (result STRING?)
- text
- Input can be any variable or expression that is assignment compatible with the STRING type (see "Assignment compatibility in EGL").
- result
- A STRING value. If text is null, the function returns a null value.
Example
Consider the following code:
function main()
origin string = “abc”;
encoded String = strlib.base64Encode(origin);
strlib.writestdout(“Encoded value: “ + encoded);
decoded String = strlib.base64Decode(encoded);
strlib.writestdout(“Decoded value: “ + decoded);
end
The output is as follows:
Encoded value: YWJj
Decoded value: abc
Compatibility
| Platform | Issue |
|---|---|
| COBOL generation | The strLib.base64Decode() function is not supported. |