Skip to main content
2 of 3
added 6 characters in body
Mr.Frodo
  • 5.8k
  • 1
  • 17
  • 37

You can use toString() of Blob class.

Example:

String myString = 'StringToBlob';
Blob myBlob = Blob.valueof(myString);
System.assertEquals('StringToBlob', myBlob.toString());

Other option is by using String.valueOf() of String class.

There is one answer of sfdcfox which you might want to check before doing anything with blob. It says:

String.valueOf is always safe to use on a Blob, but Blob.toString may result in an exception if the contents are not a Unicode String.

Mr.Frodo
  • 5.8k
  • 1
  • 17
  • 37