Hi ,
Here we are going to learn how to encode a string to Base64 format in Apex
Eg:
String urlparam = 'Salesforce Techbook';
String urlString = EncodingUtil.base64Encode(Blob.valueof(urlparam));
System.debug(urlString);
Output: U2FsZXNmb3JjZSBUZWNoYm9vaw==
Reference:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_encoding.htm
No comments:
Post a Comment