To convert sObject to String in Apex, below is the simple code.
Example:
public Account acct = new Account(Name = 'Test Account');
String objType = String.valueOf(acct);
system.debug('objType is ' + objType);
Output:
To convert sObject to String in Apex, below is the simple code.
Example:
public Account acct = new Account(Name = 'Test Account');
String objType = String.valueOf(acct);
system.debug('objType is ' + objType);
Output: