function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Suraj AdeSuraj Ade 

How to write apex code for Renaming the profile?

Devi ChandrikaDevi Chandrika (Salesforce Developers) 
Hi suraj,

We cannot perform DML operations on profile object.So you wont be able to rename a profile using apex code. Rename profile  accessing it through setup.

Hope this helps you
Let me know if this helps you. Kindly mark it as solved so that it may help others in future.

Thanks and Regards