How to get the string value from the function CountryManager::getStandardList()? Input : 

 $li = array();
    $list = \Drupal\Core\Locale\CountryManager::getStandardList();
    foreach($list as $key =&gt; $value){
        $li[$key] = $value;
    } 
    // print_r($li);


Output : 

[AF] =&gt; Drupal\Core\StringTranslation\TranslatableMarkup Object
        (
            [string:protected] =&gt; Afghanistan
            [translatedMarkup:protected] =&gt; Afghanistan
            [options:protected] =&gt; Array
                (
                )


How can I fetch String value from the above structure?
To fetch the string value from the translatable markup object use type casting:

$li[$key] = (string) $value;