How to change the label of title field How to change the label of title field bydefault its showing Title I need to change it to "Custom-title" of node edit form programatically.

I tried 

 function mymodule_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {
if ($form_id =="slices_slices_cta_5_edit_form")
{
    kint($form[title][widget][0]['#title']);
    dpm($form[title][widget][0]['#title']-&gt;jsonSerialize());
   $form[title][widget][0]['#title']-&gt;jsonSerialize()==t("Custom-title");
     //dpm($form[title][widget][0]['#title']-&gt;getArguments());

}




I just want to change [string] property of class TranslatableMarkup's object of above screen shot.

How to access the value of a Drupal\Core\StringTranslation\TranslatableMarkup object within a form

I want to do something like below example:

$form[title][widget][0]['#title']-&gt;string = t('New-title');


Not working above solution.
You can change the title label by editing the node type settings by going to Admin > Content Types > (type) > Edit. No code needed, and this can be exported to configuration.

I’m not even sure what your code is trying to do, but you don’t need it.