I would like to see the Attachment body in plain string, but cannot find out how.
For ex:
Attachment a = [SELECT Id, Name, Body, ContentType, ParentId FROM Attachment WHERE ParentId = 'a016A000000agQ6QAI'][0];
System.debug(String.valueOf(a.Body));
The output is:
12:28:14:022 USER_DEBUG [2]|DEBUG|Blob[472]
But I need to see in a String the actual content of the attachment body. How can I do it?