diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 5f6c9d4..09d623b 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -200,7 +200,7 @@ function config_get_config_directory($type = CONFIG_ACTIVE_DIRECTORY) {
   if (!empty($config_directories[$type])) {
     return $config_directories[$type];
   }
-  throw new \Exception(format_string('The configuration directory type %type does not exist.', array('%type' => $type)));
+  throw new \Exception(String::format('The configuration directory type %type does not exist.', array('%type' => $type)));
 }
 
 /**
@@ -506,7 +506,7 @@ function drupal_serve_page_from_cache(Response $response, Request $request) {
  * Basically, you can put variables like @name into your string, and t() will
  * substitute their sanitized values at translation time. (See the
  * Localization API pages referenced above and the documentation of
- * format_string() for details about how to define variables in your string.)
+ * String::format() for details about how to define variables in your string.)
  * Translators can then rearrange the string as necessary for the language
  * (e.g., in Spanish, it might be "blog de @name").
  *
@@ -515,7 +515,7 @@ function drupal_serve_page_from_cache(Response $response, Request $request) {
  * @param $args
  *   An associative array of replacements to make after translation. Based
  *   on the first character of the key, the value is escaped and/or themed.
- *   See format_string() for details.
+ *   See \Drupal\Component\Utility\String::format() for details.
  * @param $options
  *   An associative array of additional options, with the following elements:
  *   - 'langcode' (defaults to the current language): The language code to
@@ -526,7 +526,7 @@ function drupal_serve_page_from_cache(Response $response, Request $request) {
  * @return
  *   The translated string.
  *
- * @see format_string()
+ * @see \Drupal\Component\Utility\String::format()
  * @ingroup sanitization
  */
 function t($string, array $args = array(), array $options = array()) {
@@ -539,6 +539,9 @@ function t($string, array $args = array(), array $options = array()) {
  * @see \Drupal\Component\Utility\String::format()
  * @see t()
  * @ingroup sanitization
+ *
+ * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
+ *   Use \Drupal\Component\Utility\String::format().
  */
 function format_string($string, array $args = array()) {
   return String::format($string, $args);
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 001c9e7..5484519 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -419,8 +419,9 @@ function format_xml_elements($array) {
  *   An associative array of replacements to make after translation. Instances
  *   of any key in this array are replaced with the corresponding value.
  *   Based on the first character of the key, the value is escaped and/or
- *   themed. See format_string(). Note that you do not need to include @count
- *   in this array; this replacement is done automatically for the plural case.
+ *   themed. See \Drupal\Component\Utility\String::format(). Note that you do
+ *   not need to include @count in this array; this replacement is done
+ *   automatically for the plural case.
  * @param $options
  *   An associative array of additional options. See t() for allowed keys.
  *
@@ -428,7 +429,7 @@ function format_xml_elements($array) {
  *   A translated string.
  *
  * @see t()
- * @see format_string()
+ * @see \Drupal\Component\Utility\String::format()
  * @see \Drupal\Core\StringTranslation\TranslationManager->formatPlural()
  *
  * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
diff --git a/core/includes/errors.inc b/core/includes/errors.inc
index be30937..947a6e5 100644
--- a/core/includes/errors.inc
+++ b/core/includes/errors.inc
@@ -6,6 +6,7 @@
  */
 
 use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Xss;
 use Drupal\Core\Logger\RfcLogLevel;
 use Drupal\Core\Utility\Error;
@@ -168,7 +169,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
     if ($fatal) {
       // When called from CLI, simply output a plain text message.
       // Should not translate the string to avoid errors producing more errors.
-      print html_entity_decode(strip_tags(format_string('%type: !message in %function (line %line of %file).', $error))). "\n";
+      print html_entity_decode(strip_tags(String::format('%type: !message in %function (line %line of %file).', $error))). "\n";
       exit;
     }
   }
@@ -178,7 +179,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
       if (error_displayable($error)) {
         // When called from JavaScript, simply output the error message.
         // Should not translate the string to avoid errors producing more errors.
-        print format_string('%type: !message in %function (line %line of %file).', $error);
+        print String::format('%type: !message in %function (line %line of %file).', $error);
       }
       exit;
     }
@@ -204,7 +205,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
         $error['%file'] = substr($error['%file'], $root_length + 1);
       }
       // Should not translate the string to avoid errors producing more errors.
-      $message = format_string('%type: !message in %function (line %line of %file).', $error);
+      $message = String::format('%type: !message in %function (line %line of %file).', $error);
 
       // Check if verbose error reporting is on.
       $error_level = _drupal_get_error_level();
diff --git a/core/lib/Drupal/Core/Config/InstallStorage.php b/core/lib/Drupal/Core/Config/InstallStorage.php
index e9bd690..8bd234e 100644
--- a/core/lib/Drupal/Core/Config/InstallStorage.php
+++ b/core/lib/Drupal/Core/Config/InstallStorage.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Config;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Extension\ExtensionDiscovery;
 
 /**
@@ -85,7 +86,7 @@ public function getFilePath($name) {
     }
     // If any code in the early installer requests a configuration object that
     // does not exist anywhere as default config, then that must be mistake.
-    throw new StorageException(format_string('Missing configuration file: @name', array(
+    throw new StorageException(String::format('Missing configuration file: @name', array(
       '@name' => $name,
     )));
   }
diff --git a/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php b/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
index b1c1a54..9270192 100644
--- a/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
+++ b/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Entity\Query\Sql;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Database\Query\SelectInterface;
 use Drupal\Core\Entity\ContentEntityTypeInterface;
 use Drupal\Core\Entity\EntityStorageInterface;
@@ -184,7 +185,7 @@ public function addField($field, $type, $langcode) {
           $index_prefix .= "$next_index_prefix.";
         }
         else {
-          throw new QueryException(format_string('Invalid specifier @next.', array('@next' => $relationship_specifier)));
+          throw new QueryException(String::format('Invalid specifier @next.', array('@next' => $relationship_specifier)));
         }
       }
     }
@@ -207,7 +208,7 @@ protected function ensureEntityTable($index_prefix, $property, $type, $langcode,
         return $this->entityTables[$index_prefix . $table];
       }
     }
-    throw new QueryException(format_string('@property not found', array('@property' => $property)));
+    throw new QueryException(String::format('@property not found', array('@property' => $property)));
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
index dac6584..21169f2 100644
--- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
+++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
@@ -1393,7 +1393,7 @@ protected function getSharedTableFieldSchema(FieldStorageDefinitionInterface $st
 
     // Check that the schema does not include forbidden column names.
     if (array_intersect(array_keys($field_schema['columns']), $this->storage->getTableMapping()->getReservedColumns())) {
-      throw new FieldException(format_string('Illegal field column names on @field_name', array('@field_name' => $storage_definition->getName())));
+      throw new FieldException(String::format('Illegal field column names on @field_name', array('@field_name' => $storage_definition->getName())));
     }
 
     $field_name = $storage_definition->getName();
@@ -1610,7 +1610,7 @@ protected function getDedicatedTableSchema(FieldStorageDefinitionInterface $stor
     $schema = $storage_definition->getSchema();
     $table_mapping = $this->storage->getTableMapping();
     if (array_intersect(array_keys($schema['columns']), $table_mapping->getReservedColumns())) {
-      throw new FieldException(format_string('Illegal field column names on @field_name', array('@field_name' => $storage_definition->getName())));
+      throw new FieldException(String::format('Illegal field column names on @field_name', array('@field_name' => $storage_definition->getName())));
     }
 
     // Add field columns.
diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php
index 028d7d4..9527f1a 100644
--- a/core/lib/Drupal/Core/Extension/ModuleHandler.php
+++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php
@@ -750,7 +750,7 @@ public function install(array $module_list, $enable_dependencies = TRUE) {
       if (!$enabled) {
         // Throw an exception if the module name is too long.
         if (strlen($module) > DRUPAL_EXTENSION_NAME_MAX_LENGTH) {
-          throw new ExtensionNameLengthException(format_string('Module name %name is over the maximum allowed length of @max characters.', array(
+          throw new ExtensionNameLengthException(String::format('Module name %name is over the maximum allowed length of @max characters.', array(
             '%name' => $module,
             '@max' => DRUPAL_EXTENSION_NAME_MAX_LENGTH,
           )));
diff --git a/core/lib/Drupal/Core/StringTranslation/TranslationInterface.php b/core/lib/Drupal/Core/StringTranslation/TranslationInterface.php
index bc560cf..89c10ed 100644
--- a/core/lib/Drupal/Core/StringTranslation/TranslationInterface.php
+++ b/core/lib/Drupal/Core/StringTranslation/TranslationInterface.php
@@ -70,8 +70,9 @@ public function translate($string, array $args = array(), array $options = array
    *   An associative array of replacements to make after translation. Instances
    *   of any key in this array are replaced with the corresponding value.
    *   Based on the first character of the key, the value is escaped and/or
-   *   themed. See format_string(). Note that you do not need to include @count
-   *   in this array; this replacement is done automatically for the plural case.
+   *   themed. See \Drupal\Component\Utility\String::format(). Note that you do
+   *   not need to include @count in this array; this replacement is done
+   *   automatically for the plural case.
    * @param array $options
    *   An associative array of additional options. See t() for allowed keys.
    *
@@ -81,7 +82,7 @@ public function translate($string, array $args = array(), array $options = array
    * @see self::translate
    * @see \Drupal\Component\Utility\String
    * @see t()
-   * @see format_string()
+   * @see \Drupal\Component\Utility\String::format()
    */
   public function formatPlural($count, $singular, $plural, array $args = array(), array $options = array());
 
diff --git a/core/lib/Drupal/Core/TypedData/ListDataDefinition.php b/core/lib/Drupal/Core/TypedData/ListDataDefinition.php
index b710a75..16a5f1d 100644
--- a/core/lib/Drupal/Core/TypedData/ListDataDefinition.php
+++ b/core/lib/Drupal/Core/TypedData/ListDataDefinition.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\Core\TypedData;
+use Drupal\Component\Utility\String;
 
 /**
  * A typed data definition class for defining lists.
@@ -87,7 +88,7 @@ public function getClass() {
       $item_type_definition = \Drupal::typedDataManager()
         ->getDefinition($this->getItemDefinition()->getDataType());
       if (!$item_type_definition) {
-        throw new \LogicException(format_string('An invalid data type @plugin_id has been specified for list items.', array('@plugin_id' => $this->getItemDefinition()->getDataType())));
+        throw new \LogicException(String::format('An invalid data type @plugin_id has been specified for list items.', array('@plugin_id' => $this->getItemDefinition()->getDataType())));
       }
       return $item_type_definition['list_class'];
     }
diff --git a/core/lib/Drupal/Core/TypedData/TypedDataManager.php b/core/lib/Drupal/Core/TypedData/TypedDataManager.php
index 05e7f4c..b488399 100644
--- a/core/lib/Drupal/Core/TypedData/TypedDataManager.php
+++ b/core/lib/Drupal/Core/TypedData/TypedDataManager.php
@@ -86,7 +86,7 @@ public function createInstance($data_type, array $configuration = array()) {
     $type_definition = $this->getDefinition($data_type);
 
     if (!isset($type_definition)) {
-      throw new \InvalidArgumentException(format_string('Invalid data type %plugin_id has been given.', array('%plugin_id' => $data_type)));
+      throw new \InvalidArgumentException(String::format('Invalid data type %plugin_id has been given.', array('%plugin_id' => $data_type)));
     }
 
     // Allow per-data definition overrides of the used classes, i.e. take over
@@ -166,7 +166,7 @@ public function create(DataDefinitionInterface $definition, $value = NULL, $name
   public function createDataDefinition($data_type) {
     $type_definition = $this->getDefinition($data_type);
     if (!isset($type_definition)) {
-      throw new \InvalidArgumentException(format_string('Invalid data type %plugin_id has been given.', array('%plugin_id' => $data_type)));
+      throw new \InvalidArgumentException(String::format('Invalid data type %plugin_id has been given.', array('%plugin_id' => $data_type)));
     }
     $class = $type_definition['definition_class'];
     return $class::createFromDataType($data_type);
@@ -186,7 +186,7 @@ public function createDataDefinition($data_type) {
   public function createListDataDefinition($item_type) {
     $type_definition = $this->getDefinition($item_type);
     if (!isset($type_definition)) {
-      throw new \InvalidArgumentException(format_string('Invalid data type %plugin_id has been given.', array('%plugin_id' => $item_type)));
+      throw new \InvalidArgumentException(String::format('Invalid data type %plugin_id has been given.', array('%plugin_id' => $item_type)));
     }
     $class = $type_definition['list_definition_class'];
     return $class::createFromItemType($item_type);
diff --git a/core/modules/action/src/Tests/BulkFormTest.php b/core/modules/action/src/Tests/BulkFormTest.php
index 41d3245..6bc51c7 100644
--- a/core/modules/action/src/Tests/BulkFormTest.php
+++ b/core/modules/action/src/Tests/BulkFormTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\action\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 use Drupal\views\Views;
 
@@ -59,7 +60,7 @@ public function testBulkForm() {
     // Make sure a checkbox appears on all rows.
     $edit = array();
     for ($i = 0; $i < 10; $i++) {
-      $this->assertFieldById('edit-node-bulk-form-' . $i, NULL, format_string('The checkbox on row @row appears.', array('@row' => $i)));
+      $this->assertFieldById('edit-node-bulk-form-' . $i, NULL, String::format('The checkbox on row @row appears.', array('@row' => $i)));
       $edit["node_bulk_form[$i]"] = TRUE;
     }
 
@@ -69,7 +70,7 @@ public function testBulkForm() {
 
     foreach ($nodes as $node) {
       $changed_node = $node_storage->load($node->id());
-      $this->assertTrue($changed_node->isSticky(), format_string('Node @nid got marked as sticky.', array('@nid' => $node->id())));
+      $this->assertTrue($changed_node->isSticky(), String::format('Node @nid got marked as sticky.', array('@nid' => $node->id())));
     }
 
     $this->assertText('Make content sticky was applied to 10 items.');
diff --git a/core/modules/aggregator/src/Tests/AggregatorConfigurationTest.php b/core/modules/aggregator/src/Tests/AggregatorConfigurationTest.php
index 4feb6c6..66aaf36 100644
--- a/core/modules/aggregator/src/Tests/AggregatorConfigurationTest.php
+++ b/core/modules/aggregator/src/Tests/AggregatorConfigurationTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\aggregator\Tests;
+use Drupal\Component\Utility\String;
 
 /**
  * Tests aggregator settings page.
@@ -39,7 +40,7 @@ function testSettingsPage() {
     $this->assertText(t('The configuration options have been saved.'));
 
     foreach ($edit as $name => $value) {
-      $this->assertFieldByName($name, $value, format_string('"@name" has correct default value.', array('@name' => $name)));
+      $this->assertFieldByName($name, $value, String::format('"@name" has correct default value.', array('@name' => $name)));
     }
 
     // Check for our test processor settings form.
diff --git a/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php b/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php
index 844f0b1..dc80c38 100644
--- a/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php
+++ b/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php
@@ -55,7 +55,7 @@ public function testBlockLinks() {
     // Find the expected read_more link.
     $href = $feed->url();
     $links = $this->xpath('//a[@href = :href]', array(':href' => $href));
-    $this->assert(isset($links[0]), format_string('Link to href %href found.', array('%href' => $href)));
+    $this->assert(isset($links[0]), String::format('Link to href %href found.', array('%href' => $href)));
     $cache_tags_header = $this->drupalGetHeader('X-Drupal-Cache-Tags');
     $cache_tags = explode(' ', $cache_tags_header);
     $this->assertTrue(in_array('block_plugin:aggregator_feed_block', $cache_tags));
diff --git a/core/modules/aggregator/src/Tests/AggregatorTestBase.php b/core/modules/aggregator/src/Tests/AggregatorTestBase.php
index 57fcf88..e723282 100644
--- a/core/modules/aggregator/src/Tests/AggregatorTestBase.php
+++ b/core/modules/aggregator/src/Tests/AggregatorTestBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\aggregator\Tests;
 
 use Drupal\aggregator\Entity\Feed;
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 use Drupal\aggregator\FeedInterface;
 
@@ -54,7 +55,7 @@ protected function setUp() {
   function createFeed($feed_url = NULL, array $edit = array()) {
     $edit = $this->getFeedEditArray($feed_url, $edit);
     $this->drupalPostForm('aggregator/sources/add', $edit, t('Save'));
-    $this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title[0][value]'])), format_string('The feed !name has been added.', array('!name' => $edit['title[0][value]'])));
+    $this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title[0][value]'])), String::format('The feed !name has been added.', array('!name' => $edit['title[0][value]'])));
 
     $fid = db_query("SELECT fid FROM {aggregator_feed} WHERE title = :title AND url = :url", array(':title' => $edit['title[0][value]'], ':url' => $edit['url[0][value]']))->fetchField();
     $this->assertTrue(!empty($fid), 'The feed found in database.');
@@ -154,7 +155,7 @@ function getDefaultFeedItemCount() {
   function updateFeedItems(FeedInterface $feed, $expected_count = NULL) {
     // First, let's ensure we can get to the rss xml.
     $this->drupalGet($feed->getUrl());
-    $this->assertResponse(200, format_string('!url is reachable.', array('!url' => $feed->getUrl())));
+    $this->assertResponse(200, String::format('!url is reachable.', array('!url' => $feed->getUrl())));
 
     // Attempt to access the update link directly without an access token.
     $this->drupalGet('admin/config/services/aggregator/update/' . $feed->id());
@@ -173,7 +174,7 @@ function updateFeedItems(FeedInterface $feed, $expected_count = NULL) {
 
     if ($expected_count !== NULL) {
       $feed->item_count = count($feed->items);
-      $this->assertEqual($expected_count, $feed->item_count, format_string('Total items in feed equal to the total items in database (!val1 != !val2)', array('!val1' => $expected_count, '!val2' => $feed->item_count)));
+      $this->assertEqual($expected_count, $feed->item_count, String::format('Total items in feed equal to the total items in database (!val1 != !val2)', array('!val1' => $expected_count, '!val2' => $feed->item_count)));
     }
   }
 
diff --git a/core/modules/aggregator/src/Tests/FeedParserTest.php b/core/modules/aggregator/src/Tests/FeedParserTest.php
index a6d44c7..c9641f9 100644
--- a/core/modules/aggregator/src/Tests/FeedParserTest.php
+++ b/core/modules/aggregator/src/Tests/FeedParserTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\aggregator\Tests;
 
+use Drupal\Component\Utility\String;
 use Zend\Feed\Reader\Reader;
 
 /**
@@ -35,7 +36,7 @@ function testRSS091Sample() {
     $feed = $this->createFeed($this->getRSS091Sample());
     $feed->refreshItems();
     $this->drupalGet('aggregator/sources/' . $feed->id());
-    $this->assertResponse(200, format_string('Feed %name exists.', array('%name' => $feed->label())));
+    $this->assertResponse(200, String::format('Feed %name exists.', array('%name' => $feed->label())));
     $this->assertText('First example feed item title');
     $this->assertLinkByHref('http://example.com/example-turns-one');
     $this->assertText('First example feed item description.');
@@ -57,7 +58,7 @@ function testAtomSample() {
     $feed = $this->createFeed($this->getAtomSample());
     $feed->refreshItems();
     $this->drupalGet('aggregator/sources/' . $feed->id());
-    $this->assertResponse(200, format_string('Feed %name exists.', array('%name' => $feed->label())));
+    $this->assertResponse(200, String::format('Feed %name exists.', array('%name' => $feed->label())));
     $this->assertText('Atom-Powered Robots Run Amok');
     $this->assertLinkByHref('http://example.org/2003/12/13/atom03');
     $this->assertText('Some text.');
@@ -71,7 +72,7 @@ function testHtmlEntitiesSample() {
     $feed = $this->createFeed($this->getHtmlEntitiesSample());
     $feed->refreshItems();
     $this->drupalGet('aggregator/sources/' . $feed->id());
-    $this->assertResponse(200, format_string('Feed %name exists.', array('%name' => $feed->label())));
+    $this->assertResponse(200, String::format('Feed %name exists.', array('%name' => $feed->label())));
     $this->assertRaw("Quote&quot; Amp&amp;");
   }
 
diff --git a/core/modules/aggregator/src/Tests/UpdateFeedItemTest.php b/core/modules/aggregator/src/Tests/UpdateFeedItemTest.php
index a744180..898680a 100644
--- a/core/modules/aggregator/src/Tests/UpdateFeedItemTest.php
+++ b/core/modules/aggregator/src/Tests/UpdateFeedItemTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\aggregator\Tests;
 use Drupal\aggregator\Entity\Feed;
+use Drupal\Component\Utility\String;
 
 /**
  * Update feed items from a feed.
@@ -37,10 +38,10 @@ function testUpdateFeedItem() {
     );
 
     $this->drupalGet($edit['url[0][value]']);
-    $this->assertResponse(array(200), format_string('URL !url is accessible', array('!url' => $edit['url[0][value]'])));
+    $this->assertResponse(array(200), String::format('URL !url is accessible', array('!url' => $edit['url[0][value]'])));
 
     $this->drupalPostForm('aggregator/sources/add', $edit, t('Save'));
-    $this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title[0][value]'])), format_string('The feed !name has been added.', array('!name' => $edit['title[0][value]'])));
+    $this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title[0][value]'])), String::format('The feed !name has been added.', array('!name' => $edit['title[0][value]'])));
 
     $fid = db_query("SELECT fid FROM {aggregator_feed} WHERE url = :url", array(':url' => $edit['url[0][value]']))->fetchField();
     $feed = Feed::load($fid);
@@ -62,7 +63,7 @@ function testUpdateFeedItem() {
     $feed->refreshItems();
 
     $after = db_query('SELECT timestamp FROM {aggregator_item} WHERE fid = :fid', array(':fid' => $feed->id()))->fetchField();
-    $this->assertTrue($before === $after, format_string('Publish timestamp of feed item was not updated (!before === !after)', array('!before' => $before, '!after' => $after)));
+    $this->assertTrue($before === $after, String::format('Publish timestamp of feed item was not updated (!before === !after)', array('!before' => $before, '!after' => $after)));
 
     // Make sure updating items works even after disabling a module
     // that provides the selected plugins.
diff --git a/core/modules/aggregator/src/Tests/UpdateFeedTest.php b/core/modules/aggregator/src/Tests/UpdateFeedTest.php
index 55cc4e0..40be34a 100644
--- a/core/modules/aggregator/src/Tests/UpdateFeedTest.php
+++ b/core/modules/aggregator/src/Tests/UpdateFeedTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\aggregator\Tests;
+use Drupal\Component\Utility\String;
 
 /**
  * Update feed test.
@@ -28,7 +29,7 @@ function testUpdateFeed() {
         $edit[$same_field] = $feed->{$same_field}->value;
       }
       $this->drupalPostForm('aggregator/sources/' . $feed->id() . '/configure', $edit, t('Save'));
-      $this->assertRaw(t('The feed %name has been updated.', array('%name' => $edit['title[0][value]'])), format_string('The feed %name has been updated.', array('%name' => $edit['title[0][value]'])));
+      $this->assertRaw(t('The feed %name has been updated.', array('%name' => $edit['title[0][value]'])), String::format('The feed %name has been updated.', array('%name' => $edit['title[0][value]'])));
 
       // Check feed data.
       $this->assertUrl($feed->url('canonical', ['absolute' => TRUE]));
diff --git a/core/modules/block/src/Tests/BlockTest.php b/core/modules/block/src/Tests/BlockTest.php
index 881cd2b..27bcbd8 100644
--- a/core/modules/block/src/Tests/BlockTest.php
+++ b/core/modules/block/src/Tests/BlockTest.php
@@ -244,7 +244,7 @@ function moveBlockToRegion(array $block, $region) {
     $this->drupalPostForm('admin/structure/block', $edit, t('Save blocks'));
 
     // Confirm that the block was moved to the proper region.
-    $this->assertText(t('The block settings have been updated.'), format_string('Block successfully moved to %region_name region.', array( '%region_name' => $region)));
+    $this->assertText(t('The block settings have been updated.'), String::format('Block successfully moved to %region_name region.', array( '%region_name' => $region)));
 
     // Confirm that the block is being displayed.
     $this->drupalGet('');
diff --git a/core/modules/block/src/Tests/Views/DisplayBlockTest.php b/core/modules/block/src/Tests/Views/DisplayBlockTest.php
index 3c0deab..1d222cb 100644
--- a/core/modules/block/src/Tests/Views/DisplayBlockTest.php
+++ b/core/modules/block/src/Tests/Views/DisplayBlockTest.php
@@ -278,8 +278,8 @@ public function testBlockContextualLinks() {
     $id = 'block:block=' . $block->id() . ':|entity.view.edit_form:view=test_view_block:location=block&name=test_view_block&display_id=block_1';
     $cached_id = 'block:block=' . $cached_block->id() . ':|entity.view.edit_form:view=test_view_block:location=block&name=test_view_block&display_id=block_1';
     // @see \Drupal\contextual\Tests\ContextualDynamicContextTest:assertContextualLinkPlaceHolder()
-    $this->assertRaw('<div' . new Attribute(array('data-contextual-id' => $id)) . '></div>', format_string('Contextual link placeholder with id @id exists.', array('@id' => $id)));
-    $this->assertRaw('<div' . new Attribute(array('data-contextual-id' => $cached_id)) . '></div>', format_string('Contextual link placeholder with id @id exists.', array('@id' => $cached_id)));
+    $this->assertRaw('<div' . new Attribute(array('data-contextual-id' => $id)) . '></div>', String::format('Contextual link placeholder with id @id exists.', array('@id' => $id)));
+    $this->assertRaw('<div' . new Attribute(array('data-contextual-id' => $cached_id)) . '></div>', String::format('Contextual link placeholder with id @id exists.', array('@id' => $cached_id)));
 
     // Get server-rendered contextual links.
     // @see \Drupal\contextual\Tests\ContextualDynamicContextTest:renderContextualLinks()
diff --git a/core/modules/block_content/src/Tests/BlockContentCreationTest.php b/core/modules/block_content/src/Tests/BlockContentCreationTest.php
index 0262dd4..107ed6a 100644
--- a/core/modules/block_content/src/Tests/BlockContentCreationTest.php
+++ b/core/modules/block_content/src/Tests/BlockContentCreationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\block_content\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Database\Database;
 use Drupal\block_content\Entity\BlockContent;
@@ -58,7 +59,7 @@ public function testBlockContentCreation() {
     $this->drupalPostForm('block/add/basic', $edit, t('Save'));
 
     // Check that the Basic block has been created.
-    $this->assertRaw(format_string('!block %name has been created.', array(
+    $this->assertRaw(String::format('!block %name has been created.', array(
       '!block' => 'Basic block',
       '%name' => $edit['info[0][value]']
     )), 'Basic block created.');
@@ -84,7 +85,7 @@ public function testBlockContentCreation() {
     $this->drupalPostForm('block/add/basic', $edit, t('Save'));
 
     // Check that the Basic block has been created.
-    $this->assertRaw(format_string('A block with description %name already exists.', array(
+    $this->assertRaw(String::format('A block with description %name already exists.', array(
       '%name' => $edit['info[0][value]']
     )));
     $this->assertResponse(200);
@@ -104,7 +105,7 @@ public function testDefaultBlockContentCreation() {
     $this->drupalPostForm('block/add', $edit, t('Save'));
 
     // Check that the block has been created and that it is a basic block.
-    $this->assertRaw(format_string('!block %name has been created.', array(
+    $this->assertRaw(String::format('!block %name has been created.', array(
       '!block' => 'Basic block',
       '%name' => $edit['info[0][value]'],
     )), 'Basic block created.');
diff --git a/core/modules/block_content/src/Tests/BlockContentRevisionsTest.php b/core/modules/block_content/src/Tests/BlockContentRevisionsTest.php
index 79233f3..7f77de2 100644
--- a/core/modules/block_content/src/Tests/BlockContentRevisionsTest.php
+++ b/core/modules/block_content/src/Tests/BlockContentRevisionsTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\block_content\Tests;
+use Drupal\Component\Utility\String;
 
 /**
  * Create a block with revisions.
@@ -67,7 +68,7 @@ public function testRevisions() {
       // Confirm the correct revision text appears.
       $loaded = entity_revision_load('block_content', $revision_id);
       // Verify revision log is the same.
-      $this->assertEqual($loaded->getRevisionLog(), $logs[$delta], format_string('Correct log message found for revision !revision', array(
+      $this->assertEqual($loaded->getRevisionLog(), $logs[$delta], String::format('Correct log message found for revision !revision', array(
         '!revision' => $loaded->getRevisionId(),
       )));
     }
diff --git a/core/modules/block_content/src/Tests/PageEditTest.php b/core/modules/block_content/src/Tests/PageEditTest.php
index 3577547..f055d20 100644
--- a/core/modules/block_content/src/Tests/PageEditTest.php
+++ b/core/modules/block_content/src/Tests/PageEditTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\block_content\Tests;
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 
 /**
@@ -61,7 +62,7 @@ public function testPageEdit() {
     // Test deleting the block.
     $this->drupalGet("block/" . $revised_block->id());
     $this->clickLink(t('Delete'));
-    $this->assertText(format_string('Are you sure you want to delete !label?', array('!label' => $revised_block->label())));
+    $this->assertText(String::format('Are you sure you want to delete !label?', array('!label' => $revised_block->label())));
   }
 
 }
diff --git a/core/modules/book/src/Tests/BookTest.php b/core/modules/book/src/Tests/BookTest.php
index 3097ede..9e84323 100644
--- a/core/modules/book/src/Tests/BookTest.php
+++ b/core/modules/book/src/Tests/BookTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\book\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\simpletest\WebTestBase;
 
@@ -194,10 +195,10 @@ function checkBookNode(EntityInterface $node, $nodes, $previous = FALSE, $up = F
 
     // Check outline structure.
     if ($nodes !== NULL) {
-      $this->assertPattern($this->generateOutlinePattern($nodes), format_string('Node @number outline confirmed.', array('@number' => $number)));
+      $this->assertPattern($this->generateOutlinePattern($nodes), String::format('Node @number outline confirmed.', array('@number' => $number)));
     }
     else {
-      $this->pass(format_string('Node %number does not have outline.', array('%number' => $number)));
+      $this->pass(String::format('Node %number does not have outline.', array('%number' => $number)));
     }
 
     // Check previous, up, and next links.
@@ -368,7 +369,7 @@ function testBookNavigationBlock() {
     $nodes = $this->createBook();
     $this->drupalGet('<front>');
     $this->assertText($block->label(), 'Book navigation block is displayed.');
-    $this->assertText($this->book->label(), format_string('Link to book root (@title) is displayed.', array('@title' => $nodes[0]->label())));
+    $this->assertText($this->book->label(), String::format('Link to book root (@title) is displayed.', array('@title' => $nodes[0]->label())));
     $this->assertNoText($nodes[0]->label(), 'No links to individual book pages are displayed.');
   }
 
diff --git a/core/modules/comment/src/Tests/CommentFieldsTest.php b/core/modules/comment/src/Tests/CommentFieldsTest.php
index bec1f5a..b4de950 100644
--- a/core/modules/comment/src/Tests/CommentFieldsTest.php
+++ b/core/modules/comment/src/Tests/CommentFieldsTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\comment\Tests;
 
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
+use Drupal\Component\Utility\String;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\field\Entity\FieldConfig;
 
@@ -54,7 +55,7 @@ function testCommentDefaultFields() {
     $field_storage = FieldStorageConfig::loadByName('comment', 'comment_body');
     $this->assertTrue($field_storage, 'The comment_body field exists');
     $field = FieldConfig::loadByName('comment', 'comment', 'comment_body');
-    $this->assertTrue(isset($field), format_string('The comment_body field is present for comments on type @type', array('@type' => $type_name)));
+    $this->assertTrue(isset($field), String::format('The comment_body field is present for comments on type @type', array('@type' => $type_name)));
 
     // Test adding a field that defaults to CommentItemInterface::CLOSED.
     $this->container->get('comment.manager')->addDefaultField('node', 'test_node_type', 'who_likes_ponies', CommentItemInterface::CLOSED, 'who_likes_ponies');
diff --git a/core/modules/comment/src/Tests/CommentLanguageTest.php b/core/modules/comment/src/Tests/CommentLanguageTest.php
index 746aea4..c939fdd 100644
--- a/core/modules/comment/src/Tests/CommentLanguageTest.php
+++ b/core/modules/comment/src/Tests/CommentLanguageTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\comment\Entity\Comment;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
+use Drupal\Component\Utility\String;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\simpletest\WebTestBase;
 
@@ -121,7 +122,7 @@ function testCommentLanguage() {
           ->execute();
         $comment = Comment::load(reset($cids));
         $args = array('%node_language' => $node_langcode, '%comment_language' => $comment->langcode->value, '%langcode' => $langcode);
-        $this->assertEqual($comment->langcode->value, $langcode, format_string('The comment posted with content language %langcode and belonging to the node with language %node_language has language %comment_language', $args));
+        $this->assertEqual($comment->langcode->value, $langcode, String::format('The comment posted with content language %langcode and belonging to the node with language %node_language has language %comment_language', $args));
         $this->assertEqual($comment->comment_body->value, $comment_values[$node_langcode][$langcode], 'Comment body correctly stored.');
       }
     }
diff --git a/core/modules/comment/src/Tests/CommentNonNodeTest.php b/core/modules/comment/src/Tests/CommentNonNodeTest.php
index 15eb7b7..02bbe69 100644
--- a/core/modules/comment/src/Tests/CommentNonNodeTest.php
+++ b/core/modules/comment/src/Tests/CommentNonNodeTest.php
@@ -10,6 +10,7 @@
 use Drupal\comment\CommentInterface;
 use Drupal\comment\Entity\CommentType;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
+use Drupal\Component\Utility\String;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\simpletest\WebTestBase;
 use Drupal\Core\Entity\EntityInterface;
@@ -205,10 +206,10 @@ function performCommentOperation($comment, $operation, $approval = FALSE) {
 
     if ($operation == 'delete') {
       $this->drupalPostForm(NULL, array(), t('Delete comments'));
-      $this->assertRaw(format_plural(1, 'Deleted 1 comment.', 'Deleted @count comments.'), format_string('Operation "@operation" was performed on comment.', array('@operation' => $operation)));
+      $this->assertRaw(format_plural(1, 'Deleted 1 comment.', 'Deleted @count comments.'), String::format('Operation "@operation" was performed on comment.', array('@operation' => $operation)));
     }
     else {
-      $this->assertText(t('The update has been performed.'), format_string('Operation "@operation" was performed on comment.', array('@operation' => $operation)));
+      $this->assertText(t('The update has been performed.'), String::format('Operation "@operation" was performed on comment.', array('@operation' => $operation)));
     }
   }
 
diff --git a/core/modules/comment/src/Tests/CommentPagerTest.php b/core/modules/comment/src/Tests/CommentPagerTest.php
index c3fa58e..961a31c 100644
--- a/core/modules/comment/src/Tests/CommentPagerTest.php
+++ b/core/modules/comment/src/Tests/CommentPagerTest.php
@@ -185,7 +185,7 @@ function assertCommentOrder(array $comments, array $expected_order) {
     foreach ($comment_anchors as $anchor) {
       $result_order[] = substr($anchor['id'], 8);
     }
-    return $this->assertEqual($expected_cids, $result_order, format_string('Comment order: expected @expected, returned @returned.', array('@expected' => implode(',', $expected_cids), '@returned' => implode(',', $result_order))));
+    return $this->assertEqual($expected_cids, $result_order, String::format('Comment order: expected @expected, returned @returned.', array('@expected' => implode(',', $expected_cids), '@returned' => implode(',', $result_order))));
   }
 
   /**
@@ -245,7 +245,7 @@ function testCommentNewPageIndicator() {
     foreach ($expected_pages as $new_replies => $expected_page) {
       $returned_page = \Drupal::entityManager()->getStorage('comment')
         ->getNewCommentPageNumber($node->get('comment')->comment_count, $new_replies, $node);
-      $this->assertIdentical($expected_page, $returned_page, format_string('Flat mode, @new replies: expected page @expected, returned page @returned.', array('@new' => $new_replies, '@expected' => $expected_page, '@returned' => $returned_page)));
+      $this->assertIdentical($expected_page, $returned_page, String::format('Flat mode, @new replies: expected page @expected, returned page @returned.', array('@new' => $new_replies, '@expected' => $expected_page, '@returned' => $returned_page)));
     }
 
     $this->setCommentSettings('default_mode', CommentManagerInterface::COMMENT_MODE_THREADED, 'Switched to threaded mode.');
@@ -264,7 +264,7 @@ function testCommentNewPageIndicator() {
     foreach ($expected_pages as $new_replies => $expected_page) {
       $returned_page = \Drupal::entityManager()->getStorage('comment')
         ->getNewCommentPageNumber($node->get('comment')->comment_count, $new_replies, $node);
-      $this->assertEqual($expected_page, $returned_page, format_string('Threaded mode, @new replies: expected page @expected, returned page @returned.', array('@new' => $new_replies, '@expected' => $expected_page, '@returned' => $returned_page)));
+      $this->assertEqual($expected_page, $returned_page, String::format('Threaded mode, @new replies: expected page @expected, returned page @returned.', array('@new' => $new_replies, '@expected' => $expected_page, '@returned' => $returned_page)));
     }
   }
 
diff --git a/core/modules/comment/src/Tests/CommentTestBase.php b/core/modules/comment/src/Tests/CommentTestBase.php
index d86e3d4..0b65ae6 100644
--- a/core/modules/comment/src/Tests/CommentTestBase.php
+++ b/core/modules/comment/src/Tests/CommentTestBase.php
@@ -10,6 +10,7 @@
 use Drupal\comment\Entity\CommentType;
 use Drupal\comment\Entity\Comment;
 use Drupal\comment\CommentInterface;
+use Drupal\Component\Utility\String;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
 use Drupal\simpletest\WebTestBase;
@@ -253,7 +254,7 @@ public function setCommentPreview($mode, $field_name = 'comment') {
         $mode_text = 'required';
         break;
     }
-    $this->setCommentSettings('preview', $mode, format_string('Comment preview @mode_text.', array('@mode_text' => $mode_text)), $field_name);
+    $this->setCommentSettings('preview', $mode, String::format('Comment preview @mode_text.', array('@mode_text' => $mode_text)), $field_name);
   }
 
   /**
@@ -280,7 +281,7 @@ public function setCommentForm($enabled, $field_name = 'comment') {
    *   - 2: Contact information required.
    */
   function setCommentAnonymous($level) {
-    $this->setCommentSettings('anonymous', $level, format_string('Anonymous commenting set to level @level.', array('@level' => $level)));
+    $this->setCommentSettings('anonymous', $level, String::format('Anonymous commenting set to level @level.', array('@level' => $level)));
   }
 
   /**
@@ -293,7 +294,7 @@ function setCommentAnonymous($level) {
    *   Defaults to 'comment'.
    */
   public function setCommentsPerPage($number, $field_name = 'comment') {
-    $this->setCommentSettings('per_page', $number, format_string('Number of comments per page set to @number.', array('@number' => $number)), $field_name);
+    $this->setCommentSettings('per_page', $number, String::format('Number of comments per page set to @number.', array('@number' => $number)), $field_name);
   }
 
   /**
@@ -345,10 +346,10 @@ function performCommentOperation(CommentInterface $comment, $operation, $approva
 
     if ($operation == 'delete') {
       $this->drupalPostForm(NULL, array(), t('Delete comments'));
-      $this->assertRaw(format_plural(1, 'Deleted 1 comment.', 'Deleted @count comments.'), format_string('Operation "@operation" was performed on comment.', array('@operation' => $operation)));
+      $this->assertRaw(format_plural(1, 'Deleted 1 comment.', 'Deleted @count comments.'), String::format('Operation "@operation" was performed on comment.', array('@operation' => $operation)));
     }
     else {
-      $this->assertText(t('The update has been performed.'), format_string('Operation "@operation" was performed on comment.', array('@operation' => $operation)));
+      $this->assertText(t('The update has been performed.'), String::format('Operation "@operation" was performed on comment.', array('@operation' => $operation)));
     }
   }
 
diff --git a/core/modules/comment/src/Tests/CommentThreadingTest.php b/core/modules/comment/src/Tests/CommentThreadingTest.php
index 6fa1197..800e2e1 100644
--- a/core/modules/comment/src/Tests/CommentThreadingTest.php
+++ b/core/modules/comment/src/Tests/CommentThreadingTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\comment\Tests;
 
 use Drupal\comment\CommentManagerInterface;
+use Drupal\Component\Utility\String;
 
 /**
  * Tests to make sure the comment number increments properly.
@@ -142,7 +143,7 @@ protected function assertParentLink($cid, $pid) {
     //  </article>
     $pattern = "//a[@id='comment-$cid']/following-sibling::article//p[contains(@class, 'parent')]//a[contains(@href, 'comment-$pid')]";
 
-    $this->assertFieldByXpath($pattern, NULL, format_string(
+    $this->assertFieldByXpath($pattern, NULL, String::format(
       'Comment %cid has a link to parent %pid.',
       array(
         '%cid' => $cid,
@@ -165,7 +166,7 @@ protected function assertNoParentLink($cid) {
     //  </article>
 
     $pattern = "//a[@id='comment-$cid']/following-sibling::article//p[contains(@class, 'parent')]";
-    $this->assertNoFieldByXpath($pattern, NULL, format_string(
+    $this->assertNoFieldByXpath($pattern, NULL, String::format(
       'Comment %cid does not have a link to a parent.',
       array(
         '%cid' => $cid,
diff --git a/core/modules/comment/src/Tests/CommentTokenReplaceTest.php b/core/modules/comment/src/Tests/CommentTokenReplaceTest.php
index 2bf97f8..99077e1 100644
--- a/core/modules/comment/src/Tests/CommentTokenReplaceTest.php
+++ b/core/modules/comment/src/Tests/CommentTokenReplaceTest.php
@@ -75,7 +75,7 @@ function testCommentTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('comment' => $comment), array('langcode' => $language_interface->getId()));
-      $this->assertEqual($output, $expected, format_string('Sanitized comment token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Sanitized comment token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test unsanitized tokens.
@@ -91,7 +91,7 @@ function testCommentTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('comment' => $comment), array('langcode' => $language_interface->getId(), 'sanitize' => FALSE));
-      $this->assertEqual($output, $expected, format_string('Unsanitized comment token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Unsanitized comment token %token replaced.', array('%token' => $input)));
     }
 
     // Test anonymous comment author.
@@ -99,9 +99,9 @@ function testCommentTokenReplacement() {
     $comment->setOwnerId(0)->setAuthorName($author_name);
     $input = '[comment:author]';
     $output = $token_service->replace($input, array('comment' => $comment), array('langcode' => $language_interface->getId()));
-    $this->assertEqual($output, Xss::filter($author_name), format_string('Sanitized comment author token %token replaced.', array('%token' => $input)));
+    $this->assertEqual($output, Xss::filter($author_name), String::format('Sanitized comment author token %token replaced.', array('%token' => $input)));
     $output = $token_service->replace($input, array('comment' => $comment), array('langcode' => $language_interface->getId(), 'sanitize' => FALSE));
-    $this->assertEqual($output, $author_name, format_string('Unsanitized comment author token %token replaced.', array('%token' => $input)));
+    $this->assertEqual($output, $author_name, String::format('Unsanitized comment author token %token replaced.', array('%token' => $input)));
 
     // Load node so comment_count gets computed.
     $node = Node::load($node->id());
@@ -113,7 +113,7 @@ function testCommentTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('entity' => $node, 'node' => $node), array('langcode' => $language_interface->getId()));
-      $this->assertEqual($output, $expected, format_string('Node comment token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Node comment token %token replaced.', array('%token' => $input)));
     }
   }
 
diff --git a/core/modules/comment/src/Tests/Views/DefaultViewRecentCommentsTest.php b/core/modules/comment/src/Tests/Views/DefaultViewRecentCommentsTest.php
index 788ac4b..d72a537 100644
--- a/core/modules/comment/src/Tests/Views/DefaultViewRecentCommentsTest.php
+++ b/core/modules/comment/src/Tests/Views/DefaultViewRecentCommentsTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\comment\Tests\Views;
 
 use Drupal\comment\CommentInterface;
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 use Drupal\views\Tests\ViewTestBase;
 
@@ -131,7 +132,7 @@ public function testBlockDisplay() {
 
     // Check the number of results given by the display is the expected.
     $this->assertEqual(sizeof($view->result), $this->blockDisplayResults,
-      format_string('There are exactly @results comments. Expected @expected',
+      String::format('There are exactly @results comments. Expected @expected',
         array('@results' => count($view->result), '@expected' => $this->blockDisplayResults)
       )
     );
diff --git a/core/modules/config/src/Tests/ConfigCRUDTest.php b/core/modules/config/src/Tests/ConfigCRUDTest.php
index 39f790e..d3985b0 100644
--- a/core/modules/config/src/Tests/ConfigCRUDTest.php
+++ b/core/modules/config/src/Tests/ConfigCRUDTest.php
@@ -166,7 +166,7 @@ function testNameValidation() {
         unset($test_characters[$i]);
       }
     }
-    $this->assertTrue(empty($test_characters), format_string('Expected ConfigNameException was thrown for all invalid name characters: @characters', array(
+    $this->assertTrue(empty($test_characters), String::format('Expected ConfigNameException was thrown for all invalid name characters: @characters', array(
       '@characters' => implode(' ', $characters),
     )));
 
diff --git a/core/modules/config/src/Tests/ConfigDiffTest.php b/core/modules/config/src/Tests/ConfigDiffTest.php
index 7fda716..05b2055 100644
--- a/core/modules/config/src/Tests/ConfigDiffTest.php
+++ b/core/modules/config/src/Tests/ConfigDiffTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\config\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\DrupalUnitTestBase;
 
 /**
@@ -53,8 +54,8 @@ function testDiff() {
     $diff = \Drupal::service('config.manager')->diff($active, $staging, $config_name);
     $edits = $diff->getEdits();
     $this->assertEqual($edits[0]->type, 'change', 'The first item in the diff is a change.');
-    $this->assertEqual($edits[0]->orig[0], $change_key . ': ' . $original_data[$change_key], format_string("The active value for key '%change_key' is '%original_data'.", array('%change_key' => $change_key, '%original_data' => $original_data[$change_key])));
-    $this->assertEqual($edits[0]->closing[0], $change_key . ': ' . $change_data, format_string("The staging value for key '%change_key' is '%change_data'.", array('%change_key' => $change_key, '%change_data' => $change_data)));
+    $this->assertEqual($edits[0]->orig[0], $change_key . ': ' . $original_data[$change_key], String::format("The active value for key '%change_key' is '%original_data'.", array('%change_key' => $change_key, '%original_data' => $original_data[$change_key])));
+    $this->assertEqual($edits[0]->closing[0], $change_key . ': ' . $change_data, String::format("The staging value for key '%change_key' is '%change_data'.", array('%change_key' => $change_key, '%change_data' => $change_data)));
 
     // Reset data back to original, and remove a key
     $staging_data = $original_data;
@@ -66,8 +67,8 @@ function testDiff() {
     $edits = $diff->getEdits();
     $this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.');
     $this->assertEqual($edits[1]->type, 'delete', 'The second item in the diff is a delete.');
-    $this->assertEqual($edits[1]->orig[0], $remove_key . ': ' . $original_data[$remove_key], format_string("The active value for key '%remove_key' is '%original_data'.", array('%remove_key' => $remove_key, '%original_data' => $original_data[$remove_key])));
-    $this->assertFalse($edits[1]->closing, format_string("The key '%remove_key' does not exist in staging.", array('%remove_key' => $remove_key)));
+    $this->assertEqual($edits[1]->orig[0], $remove_key . ': ' . $original_data[$remove_key], String::format("The active value for key '%remove_key' is '%original_data'.", array('%remove_key' => $remove_key, '%original_data' => $original_data[$remove_key])));
+    $this->assertFalse($edits[1]->closing, String::format("The key '%remove_key' does not exist in staging.", array('%remove_key' => $remove_key)));
 
     // Reset data back to original and add a key
     $staging_data = $original_data;
@@ -79,8 +80,8 @@ function testDiff() {
     $edits = $diff->getEdits();
     $this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.');
     $this->assertEqual($edits[1]->type, 'add', 'The second item in the diff is an add.');
-    $this->assertFalse($edits[1]->orig, format_string("The key '%add_key' does not exist in active.", array('%add_key' => $add_key)));
-    $this->assertEqual($edits[1]->closing[0], $add_key . ': ' . $add_data, format_string("The staging value for key '%add_key' is '%add_data'.", array('%add_key' => $add_key, '%add_data' => $add_data)));
+    $this->assertFalse($edits[1]->orig, String::format("The key '%add_key' does not exist in active.", array('%add_key' => $add_key)));
+    $this->assertEqual($edits[1]->closing[0], $add_key . ': ' . $add_data, String::format("The staging value for key '%add_key' is '%add_data'.", array('%add_key' => $add_key, '%add_data' => $add_data)));
 
     // Test diffing a renamed config entity.
     $test_entity_id = $this->randomMachineName();
diff --git a/core/modules/config/src/Tests/ConfigEntityStorageTest.php b/core/modules/config/src/Tests/ConfigEntityStorageTest.php
index 0965fea..2da1932 100644
--- a/core/modules/config/src/Tests/ConfigEntityStorageTest.php
+++ b/core/modules/config/src/Tests/ConfigEntityStorageTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\config\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\DrupalUnitTestBase;
 use Drupal\Core\Config\ConfigDuplicateUUIDException;
 
@@ -46,7 +47,7 @@ public function testUUIDConflict() {
       $this->fail('Exception thrown when attempting to save a configuration entity with a UUID that does not match the existing UUID.');
     }
     catch (ConfigDuplicateUUIDException $e) {
-      $this->pass(format_string('Exception thrown when attempting to save a configuration entity with a UUID that does not match existing data: %e.', array('%e' => $e)));
+      $this->pass(String::format('Exception thrown when attempting to save a configuration entity with a UUID that does not match existing data: %e.', array('%e' => $e)));
     }
 
     // Ensure that the config entity was not corrupted.
diff --git a/core/modules/config/src/Tests/ConfigEntityTest.php b/core/modules/config/src/Tests/ConfigEntityTest.php
index 4bdbe25..2d1a000 100644
--- a/core/modules/config/src/Tests/ConfigEntityTest.php
+++ b/core/modules/config/src/Tests/ConfigEntityTest.php
@@ -238,9 +238,9 @@ function testCRUDUI() {
     $label1 = $this->randomMachineName();
     $label2 = $this->randomMachineName();
     $label3 = $this->randomMachineName();
-    $message_insert = format_string('%label configuration has been created.', array('%label' => $label1));
-    $message_update = format_string('%label configuration has been updated.', array('%label' => $label2));
-    $message_delete = format_string('%label configuration has been deleted.', array('%label' => $label2));
+    $message_insert = String::format('%label configuration has been created.', array('%label' => $label1));
+    $message_update = String::format('%label configuration has been updated.', array('%label' => $label2));
+    $message_delete = String::format('%label configuration has been deleted.', array('%label' => $label2));
 
     // Create a configuration entity.
     $edit = array(
@@ -311,7 +311,7 @@ function testCRUDUI() {
     );
     $this->drupalPostForm('admin/structure/config_test/add', $edit, 'Save');
     $this->assertResponse(200);
-    $message_insert = format_string('%label configuration has been created.', array('%label' => $edit['label']));
+    $message_insert = String::format('%label configuration has been created.', array('%label' => $edit['label']));
     $this->assertRaw($message_insert);
     $this->assertLinkByHref('admin/structure/config_test/manage/0');
     $this->assertLinkByHref('admin/structure/config_test/manage/0/delete');
diff --git a/core/modules/config/src/Tests/ConfigFileContentTest.php b/core/modules/config/src/Tests/ConfigFileContentTest.php
index 0f5b8d0..42e82d0 100644
--- a/core/modules/config/src/Tests/ConfigFileContentTest.php
+++ b/core/modules/config/src/Tests/ConfigFileContentTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\config\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Config\FileStorage;
 use Drupal\simpletest\DrupalUnitTestBase;
 
@@ -111,16 +112,16 @@ function testReadWriteConfig() {
     $this->assertNull($config->get('i.dont.exist'), 'Non-existent nested value returned NULL.');
 
     // Read false value.
-    $this->assertEqual($config->get($false_key), '0', format_string("Boolean FALSE value returned the string '0'."));
+    $this->assertEqual($config->get($false_key), '0', String::format("Boolean FALSE value returned the string '0'."));
 
     // Read true value.
-    $this->assertEqual($config->get($true_key), '1', format_string("Boolean TRUE value returned the string '1'."));
+    $this->assertEqual($config->get($true_key), '1', String::format("Boolean TRUE value returned the string '1'."));
 
     // Read null value.
     $this->assertIdentical($config->get('null'), NULL);
 
     // Read false that had been nested in an array value.
-    $this->assertEqual($config->get($casting_array_false_value_key), '0', format_string("Nested boolean FALSE value returned the string '0'."));
+    $this->assertEqual($config->get($casting_array_false_value_key), '0', String::format("Nested boolean FALSE value returned the string '0'."));
 
     // Unset a top level value.
     $config->clear($key);
diff --git a/core/modules/config/src/Tests/ConfigImportUITest.php b/core/modules/config/src/Tests/ConfigImportUITest.php
index e2e2118..fcd3a32 100644
--- a/core/modules/config/src/Tests/ConfigImportUITest.php
+++ b/core/modules/config/src/Tests/ConfigImportUITest.php
@@ -281,7 +281,7 @@ function testImportDiff() {
 
     // Load the diff UI and verify that the diff reflects the change.
     $this->drupalGet('admin/config/development/configuration/sync/diff/' . $config_name);
-    $this->assertTitle(format_string('View changes of @config_name | Drupal', array('@config_name' => $config_name)));
+    $this->assertTitle(String::format('View changes of @config_name | Drupal', array('@config_name' => $config_name)));
 
     // Reset data back to original, and remove a key
     $staging_data = $original_data;
diff --git a/core/modules/config/tests/config_test/src/ConfigTestForm.php b/core/modules/config/tests/config_test/src/ConfigTestForm.php
index cb847ee..d2ea21b 100644
--- a/core/modules/config/tests/config_test/src/ConfigTestForm.php
+++ b/core/modules/config/tests/config_test/src/ConfigTestForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\config_test;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Form\FormStateInterface;
 
@@ -75,10 +76,10 @@ public function save(array $form, FormStateInterface $form_state) {
     $status = $entity->save();
 
     if ($status === SAVED_UPDATED) {
-      drupal_set_message(format_string('%label configuration has been updated.', array('%label' => $entity->label())));
+      drupal_set_message(String::format('%label configuration has been updated.', array('%label' => $entity->label())));
     }
     else {
-      drupal_set_message(format_string('%label configuration has been created.', array('%label' => $entity->label())));
+      drupal_set_message(String::format('%label configuration has been created.', array('%label' => $entity->label())));
     }
 
     $form_state->setRedirect('config_test.list_page');
diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php
index 0fde6bc..c7e7ef3 100644
--- a/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php
+++ b/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\config_translation\Tests;
 
 use Drupal\Component\Serialization\Json;
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Config\FileStorage;
 use Drupal\Core\Language\Language;
@@ -674,12 +675,12 @@ public function testAlterInfo() {
    */
   protected function getTranslation($config_name, $key, $langcode) {
     $settings_locations = $this->localeStorage->getLocations(array('type' => 'configuration', 'name' => $config_name));
-    $this->assertTrue(!empty($settings_locations), format_string('Configuration locations found for %config_name.', array('%config_name' => $config_name)));
+    $this->assertTrue(!empty($settings_locations), String::format('Configuration locations found for %config_name.', array('%config_name' => $config_name)));
 
     if (!empty($settings_locations)) {
       $source = $this->container->get('config.factory')->get($config_name)->get($key);
       $source_string = $this->localeStorage->findString(array('source' => $source, 'type' => 'configuration'));
-      $this->assertTrue(!empty($source_string), format_string('Found string for %config_name.%key.', array('%config_name' => $config_name, '%key' => $key)));
+      $this->assertTrue(!empty($source_string), String::format('Found string for %config_name.%key.', array('%config_name' => $config_name, '%key' => $key)));
 
       if (!empty($source_string)) {
         $conditions = array(
diff --git a/core/modules/contact/src/Tests/ContactSitewideTest.php b/core/modules/contact/src/Tests/ContactSitewideTest.php
index be909f5..09d5bca 100644
--- a/core/modules/contact/src/Tests/ContactSitewideTest.php
+++ b/core/modules/contact/src/Tests/ContactSitewideTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\contact\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\contact\Entity\ContactForm;
 use Drupal\Core\Mail\MailFormatHelper;
@@ -63,7 +64,7 @@ function testSiteWideContact() {
     $edit_link = $this->xpath('//a[@href=:href]', array(
       ':href' => \Drupal::url('entity.contact_form.edit_form', array('contact_form' => 'personal'))
     ));
-    $this->assertTrue(empty($edit_link), format_string('No link containing href %href found.',
+    $this->assertTrue(empty($edit_link), String::format('No link containing href %href found.',
       array('%href' => 'admin/structure/contact/manage/personal')
     ));
     $this->assertNoLinkByHref('admin/structure/contact/manage/personal/delete');
@@ -110,7 +111,7 @@ function testSiteWideContact() {
     $max_length = EntityTypeInterface::BUNDLE_MAX_LENGTH;
     $max_length_exceeded = $max_length + 1;
     $this->addContactForm($id = Unicode::strtolower($this->randomMachineName($max_length_exceeded)), $label = $this->randomMachineName($max_length_exceeded), implode(',', array($recipients[0])), '', TRUE);
-    $this->assertText(format_string('Machine-readable name cannot be longer than !max characters but is currently !exceeded characters long.', array('!max' => $max_length, '!exceeded' => $max_length_exceeded)));
+    $this->assertText(String::format('Machine-readable name cannot be longer than !max characters but is currently !exceeded characters long.', array('!max' => $max_length, '!exceeded' => $max_length_exceeded)));
     $this->addContactForm($id = Unicode::strtolower($this->randomMachineName($max_length)), $label = $this->randomMachineName($max_length), implode(',', array($recipients[0])), '', TRUE);
     $this->assertRaw(t('Contact form %label has been added.', array('%label' => $label)));
 
@@ -413,7 +414,7 @@ function deleteContactForms() {
       else {
         $this->drupalPostForm("admin/structure/contact/manage/$id/delete", array(), t('Delete'));
         $this->assertRaw(t('Contact form %label has been deleted.', array('%label' => $contact_form->label())));
-        $this->assertFalse(ContactForm::load($id), format_string('Form %contact_form not found', array('%contact_form' => $contact_form->label())));
+        $this->assertFalse(ContactForm::load($id), String::format('Form %contact_form not found', array('%contact_form' => $contact_form->label())));
       }
     }
   }
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php b/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php
index ea28195..9e81ccb 100644
--- a/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\content_translation\Tests;
 
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
+use Drupal\Component\Utility\String;
 use Drupal\config\Tests\SchemaCheckTestTrait;
 use Drupal\Core\Field\Entity\BaseFieldOverride;
 use Drupal\Core\Language\Language;
@@ -220,7 +221,7 @@ function testAccountLanguageSettingsUI() {
   protected function assertSettings($entity_type, $bundle, $enabled, $edit) {
     $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save configuration'));
     $args = array('@entity_type' => $entity_type, '@bundle' => $bundle, '@enabled' => $enabled ? 'enabled' : 'disabled');
-    $message = format_string('Translation for entity @entity_type (@bundle) is @enabled.', $args);
+    $message = String::format('Translation for entity @entity_type (@bundle) is @enabled.', $args);
     \Drupal::entityManager()->clearCachedDefinitions();
     return $this->assertEqual(content_translation_enabled($entity_type, $bundle), $enabled, $message);
   }
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php b/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php
index a343190..36b5860 100644
--- a/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\content_translation\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityInterface;
 
 /**
@@ -202,13 +203,13 @@ function testImageFieldSync() {
       $value = $values[$default_langcode][$item->target_id];
       $source_item = $translation->{$this->fieldName}->get($delta);
       $assert = $item->target_id == $source_item->target_id && $item->alt == $value['alt'] && $item->title == $value['title'];
-      $this->assertTrue($assert, format_string('Field item @fid has been successfully synchronized.', array('@fid' => $item->target_id)));
+      $this->assertTrue($assert, String::format('Field item @fid has been successfully synchronized.', array('@fid' => $item->target_id)));
       $fids[$item->target_id] = TRUE;
     }
 
     // Check that the dropped value is the right one.
     $removed_fid = $this->files[0]->fid;
-    $this->assertTrue(!isset($fids[$removed_fid]), format_string('Field item @fid has been correctly removed.', array('@fid' => $removed_fid)));
+    $this->assertTrue(!isset($fids[$removed_fid]), String::format('Field item @fid has been correctly removed.', array('@fid' => $removed_fid)));
 
     // Add back an item for the dropped value and perform synchronization again.
     $values[$langcode][$removed_fid] = array(
@@ -234,7 +235,7 @@ function testImageFieldSync() {
       $value = $values[$fid_langcode][$item->target_id];
       $source_item = $translation->{$this->fieldName}->get($delta);
       $assert = $item->target_id == $source_item->target_id && $item->alt == $value['alt'] && $item->title == $value['title'];
-      $this->assertTrue($assert, format_string('Field item @fid has been successfully synchronized.', array('@fid' => $item->target_id)));
+      $this->assertTrue($assert, String::format('Field item @fid has been successfully synchronized.', array('@fid' => $item->target_id)));
     }
   }
 
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationUITest.php b/core/modules/content_translation/src/Tests/ContentTranslationUITest.php
index 5e8497b..367840a 100644
--- a/core/modules/content_translation/src/Tests/ContentTranslationUITest.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationUITest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\content_translation\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\ContentEntityBase;
 use Drupal\Core\Language\Language;
@@ -62,7 +63,7 @@ protected function doTestBasicTranslation() {
     foreach ($values[$default_langcode] as $property => $value) {
       $stored_value = $this->getValue($translation, $property, $default_langcode);
       $value = is_array($value) ? $value[0]['value'] : $value;
-      $message = format_string('@property correctly stored in the default language.', array('@property' => $property));
+      $message = String::format('@property correctly stored in the default language.', array('@property' => $property));
       $this->assertEqual($stored_value, $value, $message);
     }
 
@@ -105,7 +106,7 @@ protected function doTestBasicTranslation() {
       foreach ($property_values as $property => $value) {
         $stored_value = $this->getValue($translation, $property, $langcode);
         $value = is_array($value) ? $value[0]['value'] : $value;
-        $message = format_string('%property correctly stored with language %language.', array('%property' => $property, '%language' => $langcode));
+        $message = String::format('%property correctly stored with language %language.', array('%property' => $property, '%language' => $langcode));
         $this->assertEqual($stored_value, $value, $message);
       }
     }
@@ -123,10 +124,10 @@ protected function doTestTranslationOverview() {
         $language = new Language(array('id' => $langcode));
         $view_path = \Drupal::urlGenerator()->generateFromPath($entity->getSystemPath(), array('language' => $language));
         $elements = $this->xpath('//table//a[@href=:href]', array(':href' => $view_path));
-        $this->assertEqual((string) $elements[0], $entity->getTranslation($langcode)->label(), format_string('Label correctly shown for %language translation.', array('%language' => $langcode)));
+        $this->assertEqual((string) $elements[0], $entity->getTranslation($langcode)->label(), String::format('Label correctly shown for %language translation.', array('%language' => $langcode)));
         $edit_path = \Drupal::urlGenerator()->generateFromPath($entity->getSystemPath('edit-form'), array('language' => $language));
         $elements = $this->xpath('//table//ul[@class="dropbutton"]/li/a[@href=:href]', array(':href' => $edit_path));
-        $this->assertEqual((string) $elements[0], t('Edit'), format_string('Edit link correct for %language translation.', array('%language' => $langcode)));
+        $this->assertEqual((string) $elements[0], t('Edit'), String::format('Edit link correct for %language translation.', array('%language' => $langcode)));
       }
     }
   }
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationWorkflowsTest.php b/core/modules/content_translation/src/Tests/ContentTranslationWorkflowsTest.php
index 1c6ff21..145042b 100644
--- a/core/modules/content_translation/src/Tests/ContentTranslationWorkflowsTest.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationWorkflowsTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\content_translation\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\user\UserInterface;
 
@@ -93,10 +94,10 @@ function testWorkflows() {
 
       foreach ($ops as $op => $label) {
         if ($op != $current_op) {
-          $this->assertNoLink($label, format_string('No %op link found.', array('%op' => $label)));
+          $this->assertNoLink($label, String::format('No %op link found.', array('%op' => $label)));
         }
         else {
-          $this->assertLink($label, 0, format_string('%op link found.', array('%op' => $label)));
+          $this->assertLink($label, 0, String::format('%op link found.', array('%op' => $label)));
         }
       }
     }
@@ -121,14 +122,14 @@ protected function assertWorkflows(UserInterface $user, $expected_status) {
     $edit_path = $this->entity->getSystemPath('edit-form');
     $options = array('language' => $languages[$default_langcode]);
     $this->drupalGet($edit_path, $options);
-    $this->assertResponse($expected_status['edit'], format_string('The @user_label has the expected edit access.', $args));
+    $this->assertResponse($expected_status['edit'], String::format('The @user_label has the expected edit access.', $args));
 
     // Check whether the user is allowed to access the translation overview.
     $langcode = $this->langcodes[1];
     $translations_path = $this->entity->getSystemPath('drupal:content-translation-overview');
     $options = array('language' => $languages[$langcode]);
     $this->drupalGet($translations_path, $options);
-    $this->assertResponse($expected_status['overview'], format_string('The @user_label has the expected translation overview access.', $args));
+    $this->assertResponse($expected_status['overview'], String::format('The @user_label has the expected translation overview access.', $args));
 
     // Check whether the user is allowed to create a translation.
     $add_translation_path = $translations_path . "/add/$default_langcode/$langcode";
@@ -144,7 +145,7 @@ protected function assertWorkflows(UserInterface $user, $expected_status) {
     else {
       $this->drupalGet($add_translation_path, $options);
     }
-    $this->assertResponse($expected_status['add_translation'], format_string('The @user_label has the expected translation creation access.', $args));
+    $this->assertResponse($expected_status['add_translation'], String::format('The @user_label has the expected translation creation access.', $args));
 
     // Check whether the user is allowed to edit a translation.
     $langcode = $this->langcodes[2];
@@ -170,7 +171,7 @@ protected function assertWorkflows(UserInterface $user, $expected_status) {
     else {
       $this->drupalGet($edit_translation_path, $options);
     }
-    $this->assertResponse($expected_status['edit_translation'], format_string('The @user_label has the expected translation creation access.', $args));
+    $this->assertResponse($expected_status['edit_translation'], String::format('The @user_label has the expected translation creation access.', $args));
   }
 
   /**
diff --git a/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php b/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php
index 61fa85e..e6d254e 100644
--- a/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php
+++ b/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\contextual\Tests;
 
 use Drupal\Component\Serialization\Json;
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 use Drupal\Core\Template\Attribute;
 
@@ -117,7 +118,7 @@ function testDifferentPermissions() {
    * @return bool
    */
   protected function assertContextualLinkPlaceHolder($id) {
-    $this->assertRaw('<div' . new Attribute(array('data-contextual-id' => $id)) . '></div>', format_string('Contextual link placeholder with id @id exists.', array('@id' => $id)));
+    $this->assertRaw('<div' . new Attribute(array('data-contextual-id' => $id)) . '></div>', String::format('Contextual link placeholder with id @id exists.', array('@id' => $id)));
   }
 
   /**
@@ -129,7 +130,7 @@ protected function assertContextualLinkPlaceHolder($id) {
    * @return bool
    */
   protected function assertNoContextualLinkPlaceHolder($id) {
-    $this->assertNoRaw('<div' . new Attribute(array('data-contextual-id' => $id)) . '></div>', format_string('Contextual link placeholder with id @id does not exist.', array('@id' => $id)));
+    $this->assertNoRaw('<div' . new Attribute(array('data-contextual-id' => $id)) . '></div>', String::format('Contextual link placeholder with id @id does not exist.', array('@id' => $id)));
   }
 
   /**
diff --git a/core/modules/datetime/src/Tests/DateTimeFieldTest.php b/core/modules/datetime/src/Tests/DateTimeFieldTest.php
index 281e78c..4168dba 100644
--- a/core/modules/datetime/src/Tests/DateTimeFieldTest.php
+++ b/core/modules/datetime/src/Tests/DateTimeFieldTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\datetime\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Entity\Entity\EntityViewDisplay;
 use Drupal\simpletest\WebTestBase;
@@ -133,7 +134,7 @@ function testDateField() {
             // Verify that a date is displayed.
             $expected = format_date($date->getTimestamp(), $new_value);
             $this->renderTestEntity($id);
-            $this->assertText($expected, format_string('Formatted date field using %value format displayed as %expected.', array('%value' => $new_value, '%expected' => $expected)));
+            $this->assertText($expected, String::format('Formatted date field using %value format displayed as %expected.', array('%value' => $new_value, '%expected' => $expected)));
             break;
         }
       }
@@ -146,7 +147,7 @@ function testDateField() {
       ->save();
     $expected = $date->format(DATETIME_DATE_STORAGE_FORMAT);
     $this->renderTestEntity($id);
-    $this->assertText($expected, format_string('Formatted date field using plain format displayed as %expected.', array('%expected' => $expected)));
+    $this->assertText($expected, String::format('Formatted date field using plain format displayed as %expected.', array('%expected' => $expected)));
   }
 
   /**
@@ -198,7 +199,7 @@ function testDatetimeField() {
             // Verify that a date is displayed.
             $expected = format_date($date->getTimestamp(), $new_value);
             $this->renderTestEntity($id);
-            $this->assertText($expected, format_string('Formatted date field using %value format displayed as %expected.', array('%value' => $new_value, '%expected' => $expected)));
+            $this->assertText($expected, String::format('Formatted date field using %value format displayed as %expected.', array('%value' => $new_value, '%expected' => $expected)));
             break;
         }
       }
@@ -211,7 +212,7 @@ function testDatetimeField() {
       ->save();
     $expected = $date->format(DATETIME_DATETIME_STORAGE_FORMAT);
     $this->renderTestEntity($id);
-    $this->assertText($expected, format_string('Formatted date field using plain format displayed as %expected.', array('%expected' => $expected)));
+    $this->assertText($expected, String::format('Formatted date field using plain format displayed as %expected.', array('%expected' => $expected)));
   }
 
   /**
@@ -408,7 +409,7 @@ function testInvalidField() {
       "{$field_name}[0][value][time]" => '00:00:00',
     );
     $this->drupalPostForm(NULL, $edit, t('Save'));
-    $this->assertText('date is invalid', format_string('Invalid year value %date has been caught.', array('%date' => $date_value)));
+    $this->assertText('date is invalid', String::format('Invalid year value %date has been caught.', array('%date' => $date_value)));
 
     $date_value = '2012-75-01';
     $edit = array(
@@ -416,7 +417,7 @@ function testInvalidField() {
       "{$field_name}[0][value][time]" => '00:00:00',
     );
     $this->drupalPostForm(NULL, $edit, t('Save'));
-    $this->assertText('date is invalid', format_string('Invalid month value %date has been caught.', array('%date' => $date_value)));
+    $this->assertText('date is invalid', String::format('Invalid month value %date has been caught.', array('%date' => $date_value)));
 
     $date_value = '2012-12-99';
     $edit = array(
@@ -424,7 +425,7 @@ function testInvalidField() {
       "{$field_name}[0][value][time]" => '00:00:00',
     );
     $this->drupalPostForm(NULL, $edit, t('Save'));
-    $this->assertText('date is invalid', format_string('Invalid day value %date has been caught.', array('%date' => $date_value)));
+    $this->assertText('date is invalid', String::format('Invalid day value %date has been caught.', array('%date' => $date_value)));
 
     $date_value = '2012-12-01';
     $time_value = '';
@@ -442,7 +443,7 @@ function testInvalidField() {
       "{$field_name}[0][value][time]" => $time_value,
     );
     $this->drupalPostForm(NULL, $edit, t('Save'));
-    $this->assertText('date is invalid', format_string('Invalid hour value %time has been caught.', array('%time' => $time_value)));
+    $this->assertText('date is invalid', String::format('Invalid hour value %time has been caught.', array('%time' => $time_value)));
 
     $date_value = '2012-12-01';
     $time_value = '12:99:00';
@@ -451,7 +452,7 @@ function testInvalidField() {
       "{$field_name}[0][value][time]" => $time_value,
     );
     $this->drupalPostForm(NULL, $edit, t('Save'));
-    $this->assertText('date is invalid', format_string('Invalid minute value %time has been caught.', array('%time' => $time_value)));
+    $this->assertText('date is invalid', String::format('Invalid minute value %time has been caught.', array('%time' => $time_value)));
 
     $date_value = '2012-12-01';
     $time_value = '12:15:99';
@@ -460,7 +461,7 @@ function testInvalidField() {
       "{$field_name}[0][value][time]" => $time_value,
     );
     $this->drupalPostForm(NULL, $edit, t('Save'));
-    $this->assertText('date is invalid', format_string('Invalid second value %time has been caught.', array('%time' => $time_value)));
+    $this->assertText('date is invalid', String::format('Invalid second value %time has been caught.', array('%time' => $time_value)));
   }
 
   /**
diff --git a/core/modules/dblog/src/Tests/DbLogTest.php b/core/modules/dblog/src/Tests/DbLogTest.php
index 8f334d8..406d18d 100644
--- a/core/modules/dblog/src/Tests/DbLogTest.php
+++ b/core/modules/dblog/src/Tests/DbLogTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\dblog\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Component\Utility\Xss;
 use Drupal\Core\Logger\RfcLogLevel;
@@ -96,7 +97,7 @@ private function verifyRowLimit($row_limit) {
 
     // Check row limit variable.
     $current_limit = \Drupal::config('dblog.settings')->get('row_limit');
-    $this->assertTrue($current_limit == $row_limit, format_string('[Cache] Row limit variable of @count equals row limit of @limit', array('@count' => $current_limit, '@limit' => $row_limit)));
+    $this->assertTrue($current_limit == $row_limit, String::format('[Cache] Row limit variable of @count equals row limit of @limit', array('@count' => $current_limit, '@limit' => $row_limit)));
   }
 
   /**
@@ -110,14 +111,14 @@ private function verifyCron($row_limit) {
     $this->generateLogEntries($row_limit + 10);
     // Verify that the database log row count exceeds the row limit.
     $count = db_query('SELECT COUNT(wid) FROM {watchdog}')->fetchField();
-    $this->assertTrue($count > $row_limit, format_string('Dblog row count of @count exceeds row limit of @limit', array('@count' => $count, '@limit' => $row_limit)));
+    $this->assertTrue($count > $row_limit, String::format('Dblog row count of @count exceeds row limit of @limit', array('@count' => $count, '@limit' => $row_limit)));
 
     // Run a cron job.
     $this->cronRun();
     // Verify that the database log row count equals the row limit plus one
     // because cron adds a record after it runs.
     $count = db_query('SELECT COUNT(wid) FROM {watchdog}')->fetchField();
-    $this->assertTrue($count == $row_limit + 1, format_string('Dblog row count of @count equals row limit of @limit plus one', array('@count' => $count, '@limit' => $row_limit)));
+    $this->assertTrue($count == $row_limit + 1, String::format('Dblog row count of @count equals row limit of @limit plus one', array('@count' => $count, '@limit' => $row_limit)));
   }
 
   /**
@@ -261,7 +262,7 @@ private function doUser() {
     $this->assertResponse(200);
     // Retrieve the user object.
     $user = user_load_by_name($name);
-    $this->assertTrue($user != NULL, format_string('User @name was loaded', array('@name' => $name)));
+    $this->assertTrue($user != NULL, String::format('User @name was loaded', array('@name' => $name)));
     // pass_raw property is needed by drupalLogin.
     $user->pass_raw = $pass;
     // Login user.
@@ -274,7 +275,7 @@ private function doUser() {
       $ids[] = $row->wid;
     }
     $count_before = (isset($ids)) ? count($ids) : 0;
-    $this->assertTrue($count_before > 0, format_string('DBLog contains @count records for @name', array('@count' => $count_before, '@name' => $user->getUsername())));
+    $this->assertTrue($count_before > 0, String::format('DBLog contains @count records for @name', array('@count' => $count_before, '@name' => $user->getUsername())));
 
     // Login the admin user.
     $this->drupalLogin($this->big_user);
@@ -347,7 +348,7 @@ private function doNode($type) {
     $this->assertResponse(200);
     // Retrieve the node object.
     $node = $this->drupalGetNodeByTitle($title);
-    $this->assertTrue($node != NULL, format_string('Node @title was loaded', array('@title' => $title)));
+    $this->assertTrue($node != NULL, String::format('Node @title was loaded', array('@title' => $title)));
     // Edit the node.
     $edit = $this->getContentUpdate($type);
     $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
@@ -460,7 +461,7 @@ protected function testDBLogAddAndClear() {
     // Add a watchdog entry.
     $this->container->get('logger.dblog')->log($log['severity'], $log['message'], $log);
     // Make sure the table count has actually been incremented.
-    $this->assertEqual($count + 1, db_query('SELECT COUNT(*) FROM {watchdog}')->fetchField(), format_string('\Drupal\dblog\Logger\DbLog->log() added an entry to the dblog :count', array(':count' => $count)));
+    $this->assertEqual($count + 1, db_query('SELECT COUNT(*) FROM {watchdog}')->fetchField(), String::format('\Drupal\dblog\Logger\DbLog->log() added an entry to the dblog :count', array(':count' => $count)));
     // Login the admin user.
     $this->drupalLogin($this->big_user);
     // Post in order to clear the database table.
@@ -469,7 +470,7 @@ protected function testDBLogAddAndClear() {
     $this->drupalPostForm(NULL, array(), 'Confirm');
     // Count the rows in watchdog that previously related to the deleted user.
     $count = db_query('SELECT COUNT(*) FROM {watchdog}')->fetchField();
-    $this->assertEqual($count, 0, format_string('DBLog contains :count records after a clear.', array(':count' => $count)));
+    $this->assertEqual($count, 0, String::format('DBLog contains :count records after a clear.', array(':count' => $count)));
   }
 
   /**
diff --git a/core/modules/editor/src/Tests/EditorSecurityTest.php b/core/modules/editor/src/Tests/EditorSecurityTest.php
index 6a19d3e..1a23dcc 100644
--- a/core/modules/editor/src/Tests/EditorSecurityTest.php
+++ b/core/modules/editor/src/Tests/EditorSecurityTest.php
@@ -281,7 +281,7 @@ function testInitialSecurity() {
     // Log in as each user that may edit the content, and assert the value.
     foreach ($expected as $case) {
       foreach ($case['users'] as $account) {
-        $this->pass(format_string('Scenario: sample %sample_id, %format.', array(
+        $this->pass(String::format('Scenario: sample %sample_id, %format.', array(
           '%sample_id' => $case['node_id'],
           '%format' => $case['format'],
         )));
@@ -400,7 +400,7 @@ function testSwitchingSecurity() {
 
       // Switch to every other text format/editor and verify the results.
       foreach ($case['switch_to'] as $format => $expected_filtered_value) {
-        $this->pass(format_string('Scenario: sample %sample_id, switch from %original_format to %format.', array(
+        $this->pass(String::format('Scenario: sample %sample_id, switch from %original_format to %format.', array(
           '%sample_id' => $case['node_id'],
           '%original_format' => $case['format'],
           '%format' => $format,
diff --git a/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php b/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
index 4c09ecf..3f7f114 100644
--- a/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
+++ b/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\entity_reference\Plugin\Field\FieldFormatter;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Form\FormStateInterface;
@@ -76,7 +77,7 @@ public function viewElements(FieldItemListInterface $items) {
       static $depth = 0;
       $depth++;
       if ($depth > 20) {
-        throw new RecursiveRenderingException(format_string('Recursive rendering detected when rendering entity @entity_type(@entity_id). Aborting rendering.', array('@entity_type' => $entity->getEntityTypeId(), '@entity_id' => $entity->id())));
+        throw new RecursiveRenderingException(String::format('Recursive rendering detected when rendering entity @entity_type(@entity_id). Aborting rendering.', array('@entity_type' => $entity->getEntityTypeId(), '@entity_id' => $entity->id())));
       }
 
       if ($entity->id()) {
diff --git a/core/modules/entity_reference/src/Tests/EntityReferenceFormatterTest.php b/core/modules/entity_reference/src/Tests/EntityReferenceFormatterTest.php
index d51da8c..e85f735 100644
--- a/core/modules/entity_reference/src/Tests/EntityReferenceFormatterTest.php
+++ b/core/modules/entity_reference/src/Tests/EntityReferenceFormatterTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\entity_reference\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Cache\Cache;
 use Drupal\filter\Entity\FilterFormat;
 use Drupal\system\Tests\Entity\EntityUnitTestBase;
@@ -121,7 +122,7 @@ public function testAccess() {
       entity_view($referencing_entity, 'default');
 
       // Verify the un-accessible item still exists.
-      $this->assertEqual($referencing_entity->{$field_name}->target_id, $this->referencedEntity->id(), format_string('The un-accessible item still exists after @name formatter was executed.', array('@name' => $name)));
+      $this->assertEqual($referencing_entity->{$field_name}->target_id, $this->referencedEntity->id(), String::format('The un-accessible item still exists after @name formatter was executed.', array('@name' => $name)));
     }
   }
 
@@ -142,8 +143,8 @@ public function testIdFormatter() {
     $items = $referencing_entity->get($field_name);
     $build = $items->view(array('type' => $formatter));
 
-    $this->assertEqual($build[0]['#markup'], $this->referencedEntity->id(), format_string('The markup returned by the @formatter formatter is correct.', array('@formatter' => $formatter)));
-    $this->assertEqual($build[0]['#cache']['tags'], $this->referencedEntity->getCacheTags(), format_string('The @formatter formatter has the expected cache tags.', array('@formatter' => $formatter)));
+    $this->assertEqual($build[0]['#markup'], $this->referencedEntity->id(), String::format('The markup returned by the @formatter formatter is correct.', array('@formatter' => $formatter)));
+    $this->assertEqual($build[0]['#cache']['tags'], $this->referencedEntity->getCacheTags(), String::format('The @formatter formatter has the expected cache tags.', array('@formatter' => $formatter)));
 
   }
 
@@ -178,13 +179,13 @@ public function testEntityFormatter() {
 </div>
 ';
     drupal_render($build[0]);
-    $this->assertEqual($build[0]['#markup'], 'default | ' . $this->referencedEntity->label() .  $expected_rendered_name_field . $expected_rendered_body_field, format_string('The markup returned by the @formatter formatter is correct.', array('@formatter' => $formatter)));
+    $this->assertEqual($build[0]['#markup'], 'default | ' . $this->referencedEntity->label() .  $expected_rendered_name_field . $expected_rendered_body_field, String::format('The markup returned by the @formatter formatter is correct.', array('@formatter' => $formatter)));
     $expected_cache_tags = Cache::mergeTags(
       \Drupal::entityManager()->getViewBuilder($this->entityType)->getCacheTags(),
       $this->referencedEntity->getCacheTags(),
       FilterFormat::load('full_html')->getCacheTags()
     );
-    $this->assertEqual($build[0]['#cache']['tags'], $expected_cache_tags, format_string('The @formatter formatter has the expected cache tags.', array('@formatter' => $formatter)));
+    $this->assertEqual($build[0]['#cache']['tags'], $expected_cache_tags, String::format('The @formatter formatter has the expected cache tags.', array('@formatter' => $formatter)));
   }
 
 }
diff --git a/core/modules/entity_reference/src/Tests/EntityReferenceIntegrationTest.php b/core/modules/entity_reference/src/Tests/EntityReferenceIntegrationTest.php
index 69f9031..237a448 100644
--- a/core/modules/entity_reference/src/Tests/EntityReferenceIntegrationTest.php
+++ b/core/modules/entity_reference/src/Tests/EntityReferenceIntegrationTest.php
@@ -167,7 +167,7 @@ public function testSupportedEntityTypesAndWidgets() {
   protected function assertFieldValues($entity_name, $referenced_entities) {
     $entity = current(entity_load_multiple_by_properties($this->entityType, array('name' => $entity_name)));
 
-    $this->assertTrue($entity, format_string('%entity_type: Entity found in the database.', array('%entity_type' => $this->entityType)));
+    $this->assertTrue($entity, String::format('%entity_type: Entity found in the database.', array('%entity_type' => $this->entityType)));
 
     $this->assertEqual($entity->{$this->fieldName}->target_id, $referenced_entities[0]->id());
     $this->assertEqual($entity->{$this->fieldName}->entity->id(), $referenced_entities[0]->id());
diff --git a/core/modules/entity_reference/src/Tests/EntityReferenceSelectionAccessTest.php b/core/modules/entity_reference/src/Tests/EntityReferenceSelectionAccessTest.php
index a6edb35..952a34b 100644
--- a/core/modules/entity_reference/src/Tests/EntityReferenceSelectionAccessTest.php
+++ b/core/modules/entity_reference/src/Tests/EntityReferenceSelectionAccessTest.php
@@ -35,7 +35,7 @@ protected function assertReferenceable(FieldDefinitionInterface $field_definitio
     foreach ($tests as $test) {
       foreach ($test['arguments'] as $arguments) {
         $result = call_user_func_array(array($handler, 'getReferenceableEntities'), $arguments);
-        $this->assertEqual($result, $test['result'], format_string('Valid result set returned by @handler.', array('@handler' => $handler_name)));
+        $this->assertEqual($result, $test['result'], String::format('Valid result set returned by @handler.', array('@handler' => $handler_name)));
 
         $result = call_user_func_array(array($handler, 'countReferenceableEntities'), $arguments);
         if (!empty($test['result'])) {
@@ -46,7 +46,7 @@ protected function assertReferenceable(FieldDefinitionInterface $field_definitio
           $count = 0;
         }
 
-        $this->assertEqual($result, $count, format_string('Valid count returned by @handler.', array('@handler' => $handler_name)));
+        $this->assertEqual($result, $count, String::format('Valid count returned by @handler.', array('@handler' => $handler_name)));
       }
     }
   }
diff --git a/core/modules/field/src/Tests/DisplayApiTest.php b/core/modules/field/src/Tests/DisplayApiTest.php
index 4123ab3..df9bf16 100644
--- a/core/modules/field/src/Tests/DisplayApiTest.php
+++ b/core/modules/field/src/Tests/DisplayApiTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\Entity\EntityViewMode;
 
 /**
@@ -126,7 +127,7 @@ function testFieldItemListView() {
     $setting = $settings['test_formatter_setting'];
     $this->assertText($this->label, 'Label was displayed.');
     foreach ($this->values as $delta => $value) {
-      $this->assertText($setting . '|' . $value['value'], format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
+      $this->assertText($setting . '|' . $value['value'], String::format('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
     }
 
     // Display settings: Check hidden field.
@@ -185,7 +186,7 @@ function testFieldItemListView() {
     $this->assertNoText($this->label, 'Label was not displayed.');
     $this->assertNoText('field_test_entity_display_build_alter', 'Alter not fired.');
     foreach ($this->values as $delta => $value) {
-      $this->assertText($setting . '|' . $value['value'] . '|' . ($value['value'] + 1), format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
+      $this->assertText($setting . '|' . $value['value'] . '|' . ($value['value'] + 1), String::format('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
     }
 
     // View mode: check that display settings specified in the display object
@@ -195,7 +196,7 @@ function testFieldItemListView() {
     $setting = $this->display_options['teaser']['settings']['test_formatter_setting'];
     $this->assertText($this->label, 'Label was displayed.');
     foreach ($this->values as $delta => $value) {
-      $this->assertText($setting . '|' . $value['value'], format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
+      $this->assertText($setting . '|' . $value['value'], String::format('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
     }
 
     // Unknown view mode: check that display settings for 'default' view mode
@@ -205,7 +206,7 @@ function testFieldItemListView() {
     $setting = $this->display_options['default']['settings']['test_formatter_setting'];
     $this->assertText($this->label, 'Label was displayed.');
     foreach ($this->values as $delta => $value) {
-      $this->assertText($setting . '|' . $value['value'], format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
+      $this->assertText($setting . '|' . $value['value'], String::format('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
     }
   }
 
@@ -220,7 +221,7 @@ function testFieldItemView() {
       $item = $this->entity->{$this->field_name}[$delta];
       $build = $item->view();
       $this->render($build);
-      $this->assertText($setting . '|' . $value['value'], format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
+      $this->assertText($setting . '|' . $value['value'], String::format('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
     }
 
     // Check that explicit display settings are used.
@@ -235,7 +236,7 @@ function testFieldItemView() {
       $item = $this->entity->{$this->field_name}[$delta];
       $build = $item->view($display);
       $this->render($build);
-      $this->assertText($setting . '|0:' . $value['value'], format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
+      $this->assertText($setting . '|0:' . $value['value'], String::format('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
     }
 
     // Check that prepare_view steps are invoked.
@@ -250,7 +251,7 @@ function testFieldItemView() {
       $item = $this->entity->{$this->field_name}[$delta];
       $build = $item->view($display);
       $this->render($build);
-      $this->assertText($setting . '|' . $value['value'] . '|' . ($value['value'] + 1), format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
+      $this->assertText($setting . '|' . $value['value'] . '|' . ($value['value'] + 1), String::format('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
     }
 
     // View mode: check that display settings specified in the field are used.
@@ -259,7 +260,7 @@ function testFieldItemView() {
       $item = $this->entity->{$this->field_name}[$delta];
       $build = $item->view('teaser');
       $this->render($build);
-      $this->assertText($setting . '|' . $value['value'], format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
+      $this->assertText($setting . '|' . $value['value'], String::format('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
     }
 
     // Unknown view mode: check that display settings for 'default' view mode
@@ -269,7 +270,7 @@ function testFieldItemView() {
       $item = $this->entity->{$this->field_name}[$delta];
       $build = $item->view('unknown_view_mode');
       $this->render($build);
-      $this->assertText($setting . '|' . $value['value'], format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
+      $this->assertText($setting . '|' . $value['value'], String::format('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
     }
   }
 
diff --git a/core/modules/field/src/Tests/FieldAttachStorageTest.php b/core/modules/field/src/Tests/FieldAttachStorageTest.php
index 9efb200..24f8f80 100644
--- a/core/modules/field/src/Tests/FieldAttachStorageTest.php
+++ b/core/modules/field/src/Tests/FieldAttachStorageTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\field\Tests;
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\field\Entity\FieldConfig;
 
@@ -56,17 +57,17 @@ function testFieldAttachSaveLoad() {
     $this->assertEqual(count($entity->{$this->fieldTestData->field_name}), $cardinality, 'Current revision: expected number of values');
     for ($delta = 0; $delta < $cardinality; $delta++) {
       // The field value loaded matches the one inserted or updated.
-      $this->assertEqual($entity->{$this->fieldTestData->field_name}[$delta]->value , $values[$current_revision][$delta]['value'], format_string('Current revision: expected value %delta was found.', array('%delta' => $delta)));
+      $this->assertEqual($entity->{$this->fieldTestData->field_name}[$delta]->value , $values[$current_revision][$delta]['value'], String::format('Current revision: expected value %delta was found.', array('%delta' => $delta)));
     }
 
     // Confirm each revision loads the correct data.
     foreach (array_keys($values) as $revision_id) {
       $entity = $storage->loadRevision($revision_id);
       // Number of values per field loaded equals the field cardinality.
-      $this->assertEqual(count($entity->{$this->fieldTestData->field_name}), $cardinality, format_string('Revision %revision_id: expected number of values.', array('%revision_id' => $revision_id)));
+      $this->assertEqual(count($entity->{$this->fieldTestData->field_name}), $cardinality, String::format('Revision %revision_id: expected number of values.', array('%revision_id' => $revision_id)));
       for ($delta = 0; $delta < $cardinality; $delta++) {
         // The field value loaded matches the one inserted or updated.
-        $this->assertEqual($entity->{$this->fieldTestData->field_name}[$delta]->value, $values[$revision_id][$delta]['value'], format_string('Revision %revision_id: expected value %delta was found.', array('%revision_id' => $revision_id, '%delta' => $delta)));
+        $this->assertEqual($entity->{$this->fieldTestData->field_name}[$delta]->value, $values[$revision_id][$delta]['value'], String::format('Revision %revision_id: expected value %delta was found.', array('%revision_id' => $revision_id, '%delta' => $delta)));
       }
     }
   }
@@ -136,7 +137,7 @@ function testFieldAttachLoadMultiple() {
           continue;
         }
         // The field value loaded matches the one inserted.
-        $this->assertEqual($entity->{$field_name}->value, $values[$index][$field_name], format_string('Entity %index: expected value was found.', array('%index' => $index)));
+        $this->assertEqual($entity->{$field_name}->value, $values[$index][$field_name], String::format('Entity %index: expected value was found.', array('%index' => $index)));
       }
     }
   }
diff --git a/core/modules/field/src/Tests/FieldDataCountTest.php b/core/modules/field/src/Tests/FieldDataCountTest.php
index 1930c27..1d25c5f 100644
--- a/core/modules/field/src/Tests/FieldDataCountTest.php
+++ b/core/modules/field/src/Tests/FieldDataCountTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
 
 /**
@@ -135,7 +136,7 @@ public function testEntityCountAndHasData() {
 
     $storage =  $this->container->get('entity.manager')->getStorage($entity_type);
     $entity = $storage->loadRevision($first_revision);
-    $this->assertEqual(count($entity->{$this->fieldTestData->field_name_2}), $cardinality, format_string('Revision %revision_id: expected number of values.', array('%revision_id' => $first_revision)));
+    $this->assertEqual(count($entity->{$this->fieldTestData->field_name_2}), $cardinality, String::format('Revision %revision_id: expected number of values.', array('%revision_id' => $first_revision)));
   }
 
 }
diff --git a/core/modules/field/src/Tests/FieldTestBase.php b/core/modules/field/src/Tests/FieldTestBase.php
index d71f152..958590f 100644
--- a/core/modules/field/src/Tests/FieldTestBase.php
+++ b/core/modules/field/src/Tests/FieldTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\simpletest\WebTestBase;
@@ -60,7 +61,7 @@ function assertFieldValues(EntityInterface $entity, $field_name, $expected_value
     $values = $field->getValue();
     $this->assertEqual(count($values), count($expected_values), 'Expected number of values were saved.');
     foreach ($expected_values as $key => $value) {
-      $this->assertEqual($values[$key][$column], $value, format_string('Value @value was saved correctly.', array('@value' => $value)));
+      $this->assertEqual($values[$key][$column], $value, String::format('Value @value was saved correctly.', array('@value' => $value)));
     }
   }
 }
diff --git a/core/modules/field/src/Tests/FieldTypePluginManagerTest.php b/core/modules/field/src/Tests/FieldTypePluginManagerTest.php
index ea12c40..c9402ea 100644
--- a/core/modules/field/src/Tests/FieldTypePluginManagerTest.php
+++ b/core/modules/field/src/Tests/FieldTypePluginManagerTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\field\Tests;
+use Drupal\Component\Utility\String;
 
 /**
  * Tests the field type manager.
@@ -21,8 +22,8 @@ function testDefaultSettings() {
     $field_type_manager = \Drupal::service('plugin.manager.field.field_type');
     foreach (array('test_field', 'shape', 'hidden_test_field') as $type) {
       $definition = $field_type_manager->getDefinition($type);
-      $this->assertIdentical($field_type_manager->getDefaultStorageSettings($type), $definition['class']::defaultStorageSettings(), format_string("%type storage settings were returned", array('%type' => $type)));
-      $this->assertIdentical($field_type_manager->getDefaultFieldSettings($type), $definition['class']::defaultFieldSettings(), format_string(" %type field settings were returned", array('%type' => $type)));
+      $this->assertIdentical($field_type_manager->getDefaultStorageSettings($type), $definition['class']::defaultStorageSettings(), String::format("%type storage settings were returned", array('%type' => $type)));
+      $this->assertIdentical($field_type_manager->getDefaultFieldSettings($type), $definition['class']::defaultFieldSettings(), String::format(" %type field settings were returned", array('%type' => $type)));
     }
   }
 
diff --git a/core/modules/field/src/Tests/FieldUnitTestBase.php b/core/modules/field/src/Tests/FieldUnitTestBase.php
index 0b0895f..e6e4131 100644
--- a/core/modules/field/src/Tests/FieldUnitTestBase.php
+++ b/core/modules/field/src/Tests/FieldUnitTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Language\LanguageInterface;
@@ -199,7 +200,7 @@ protected function assertFieldValues(EntityInterface $entity, $field_name, $expe
     $values = $field->getValue();
     $this->assertEqual(count($values), count($expected_values), 'Expected number of values were saved.');
     foreach ($expected_values as $key => $value) {
-      $this->assertEqual($values[$key][$column], $value, format_string('Value @value was saved correctly.', array('@value' => $value)));
+      $this->assertEqual($values[$key][$column], $value, String::format('Value @value was saved correctly.', array('@value' => $value)));
     }
   }
 
diff --git a/core/modules/field/src/Tests/String/StringFormatterTest.php b/core/modules/field/src/Tests/String/StringFormatterTest.php
index 0cf3f77..d5be3bd 100644
--- a/core/modules/field/src/Tests/String/StringFormatterTest.php
+++ b/core/modules/field/src/Tests/String/StringFormatterTest.php
@@ -121,7 +121,7 @@ public function testStringFormatter() {
 
     // Verify the cache tags.
     $build = $entity->{$this->fieldName}->view();
-    $this->assertTrue(!isset($build[0]['#cache']), format_string('The string formatter has no cache tags.'));
+    $this->assertTrue(!isset($build[0]['#cache']), String::format('The string formatter has no cache tags.'));
   }
 
 }
diff --git a/core/modules/field/src/Tests/TranslationTest.php b/core/modules/field/src/Tests/TranslationTest.php
index bbf16a6..7357522 100644
--- a/core/modules/field/src/Tests/TranslationTest.php
+++ b/core/modules/field/src/Tests/TranslationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\language\Entity\ConfigurableLanguage;
 
@@ -135,7 +136,7 @@ function testTranslatableFieldSaveLoad() {
       foreach ($items as $delta => $item) {
         $result = $result && $item['value'] == $entity->getTranslation($langcode)->{$this->field_name}[$delta]->value;
       }
-      $this->assertTrue($result, format_string('%language translation correctly handled.', array('%language' => $langcode)));
+      $this->assertTrue($result, String::format('%language translation correctly handled.', array('%language' => $langcode)));
     }
 
     // Test default values.
@@ -169,7 +170,7 @@ function testTranslatableFieldSaveLoad() {
     // @todo Test every translation once the Entity Translation API allows for
     //   multilingual defaults.
     $langcode = $entity->language()->getId();
-    $this->assertEqual($entity->getTranslation($langcode)->{$field_name_default}->getValue(), $field->default_value, format_string('Default value correctly populated for language %language.', array('%language' => $langcode)));
+    $this->assertEqual($entity->getTranslation($langcode)->{$field_name_default}->getValue(), $field->default_value, String::format('Default value correctly populated for language %language.', array('%language' => $langcode)));
 
     // Check that explicit empty values are not overridden with default values.
     foreach (array(NULL, array()) as $empty_items) {
@@ -183,7 +184,7 @@ function testTranslatableFieldSaveLoad() {
       }
 
       foreach ($entity->getTranslationLanguages() as $langcode => $language) {
-        $this->assertEqual($entity->getTranslation($langcode)->{$field_name_default}->getValue(), $empty_items, format_string('Empty value correctly populated for language %language.', array('%language' => $langcode)));
+        $this->assertEqual($entity->getTranslation($langcode)->{$field_name_default}->getValue(), $empty_items, String::format('Empty value correctly populated for language %language.', array('%language' => $langcode)));
       }
     }
   }
diff --git a/core/modules/field/src/Tests/TranslationWebTest.php b/core/modules/field/src/Tests/TranslationWebTest.php
index a5d8e09..4443bc1 100644
--- a/core/modules/field/src/Tests/TranslationWebTest.php
+++ b/core/modules/field/src/Tests/TranslationWebTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\language\Entity\ConfigurableLanguage;
 
@@ -128,7 +129,7 @@ private function checkTranslationRevisions($id, $revision_id, $available_langcod
     $entity = entity_revision_load($this->entity_type, $revision_id);
     foreach ($available_langcodes as $langcode => $value) {
       $passed = $entity->getTranslation($langcode)->{$field_name}->value == $value + 1;
-      $this->assertTrue($passed, format_string('The @language translation for revision @revision was correctly stored', array('@language' => $langcode, '@revision' => $entity->getRevisionId())));
+      $this->assertTrue($passed, String::format('The @language translation for revision @revision was correctly stored', array('@language' => $langcode, '@revision' => $entity->getRevisionId())));
     }
   }
 }
diff --git a/core/modules/field_ui/src/Tests/ManageFieldsTest.php b/core/modules/field_ui/src/Tests/ManageFieldsTest.php
index be5226d..f1fe9d7 100644
--- a/core/modules/field_ui/src/Tests/ManageFieldsTest.php
+++ b/core/modules/field_ui/src/Tests/ManageFieldsTest.php
@@ -93,13 +93,13 @@ function manageFieldsPage($type = '') {
     );
     foreach ($table_headers as $table_header) {
       // We check that the label appear in the table headings.
-      $this->assertRaw($table_header . '</th>', format_string('%table_header table header was found.', array('%table_header' => $table_header)));
+      $this->assertRaw($table_header . '</th>', String::format('%table_header table header was found.', array('%table_header' => $table_header)));
     }
 
     // "Add new field" and "Re-use existing field" aren't a table heading so just
     // test the text.
     foreach (array('Add new field', 'Re-use existing field') as $element) {
-      $this->assertText($element, format_string('"@element" was found.', array('@element' => $element)));
+      $this->assertText($element, String::format('"@element" was found.', array('@element' => $element)));
     }
 
     // Assert entity operations for all fields.
@@ -299,7 +299,7 @@ function testFieldPrefix() {
     );
     $this->fieldUIAddNewField('admin/structure/types/manage/' . $this->type, $edit);
     $this->drupalGet('admin/structure/types/manage/' . $this->type . '/fields/node.' . $this->type . '.' . $field_prefix . $this->field_name_input);
-    $this->assertText(format_string('@label settings for @type', array('@label' => $this->field_label, '@type' => $this->type)));
+    $this->assertText(String::format('@label settings for @type', array('@label' => $this->field_label, '@type' => $this->type)));
   }
 
   /**
@@ -492,7 +492,7 @@ function testHiddenFields() {
     entity_get_form_display('node', $this->type, 'default')
       ->setComponent($field_name)
       ->save();
-    $this->assertTrue(entity_load('field_config', 'node.' . $this->type . '.' . $field_name), format_string('A field of the field storage %field was created programmatically.', array('%field' => $field_name)));
+    $this->assertTrue(entity_load('field_config', 'node.' . $this->type . '.' . $field_name), String::format('A field of the field storage %field was created programmatically.', array('%field' => $field_name)));
 
     // Check that the newly added field appears on the 'Manage Fields'
     // screen.
diff --git a/core/modules/file/src/Tests/FileFieldDisplayTest.php b/core/modules/file/src/Tests/FileFieldDisplayTest.php
index 68c1179..9e36a79 100644
--- a/core/modules/file/src/Tests/FileFieldDisplayTest.php
+++ b/core/modules/file/src/Tests/FileFieldDisplayTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\file\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 
 /**
@@ -45,7 +46,7 @@ function testNodeDisplay() {
       );
       $this->drupalPostForm("admin/structure/types/manage/$type_name/display", $edit, t('Save'));
       $this->drupalGet('node/' . $node->id());
-      $this->assertNoText($field_name, format_string('Field label is hidden when no file attached for formatter %formatter', array('%formatter' => $formatter)));
+      $this->assertNoText($field_name, String::format('Field label is hidden when no file attached for formatter %formatter', array('%formatter' => $formatter)));
     }
 
     $test_file = $this->getTestFile('text');
diff --git a/core/modules/file/src/Tests/FileFieldPathTest.php b/core/modules/file/src/Tests/FileFieldPathTest.php
index bf166ed..377dc6f 100644
--- a/core/modules/file/src/Tests/FileFieldPathTest.php
+++ b/core/modules/file/src/Tests/FileFieldPathTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\file\Tests;
+use Drupal\Component\Utility\String;
 
 /**
  * Tests that files are uploaded to proper locations.
@@ -30,7 +31,7 @@ function testUploadPath() {
     $node_storage->resetCache(array($nid));
     $node = $node_storage->load($nid);
     $node_file = file_load($node->{$field_name}->target_id);
-    $this->assertPathMatch('public://' . $test_file->getFilename(), $node_file->getFileUri(), format_string('The file %file was uploaded to the correct path.', array('%file' => $node_file->getFileUri())));
+    $this->assertPathMatch('public://' . $test_file->getFilename(), $node_file->getFileUri(), String::format('The file %file was uploaded to the correct path.', array('%file' => $node_file->getFileUri())));
 
     // Change the path to contain multiple subdirectories.
     $this->updateFileField($field_name, $type_name, array('file_directory' => 'foo/bar/baz'));
@@ -42,7 +43,7 @@ function testUploadPath() {
     $node_storage->resetCache(array($nid));
     $node = $node_storage->load($nid);
     $node_file = file_load($node->{$field_name}->target_id, TRUE);
-    $this->assertPathMatch('public://foo/bar/baz/' . $test_file->getFilename(), $node_file->getFileUri(), format_string('The file %file was uploaded to the correct path.', array('%file' => $node_file->getFileUri())));
+    $this->assertPathMatch('public://foo/bar/baz/' . $test_file->getFilename(), $node_file->getFileUri(), String::format('The file %file was uploaded to the correct path.', array('%file' => $node_file->getFileUri())));
 
     // Check the path when used with tokens.
     // Change the path to contain multiple token directories.
@@ -59,7 +60,7 @@ function testUploadPath() {
     // the user running the test case.
     $data = array('user' => $this->admin_user);
     $subdirectory = \Drupal::token()->replace('[user:uid]/[user:name]', $data);
-    $this->assertPathMatch('public://' . $subdirectory . '/' . $test_file->getFilename(), $node_file->getFileUri(), format_string('The file %file was uploaded to the correct path with token replacements.', array('%file' => $node_file->getFileUri())));
+    $this->assertPathMatch('public://' . $subdirectory . '/' . $test_file->getFilename(), $node_file->getFileUri(), String::format('The file %file was uploaded to the correct path with token replacements.', array('%file' => $node_file->getFileUri())));
   }
 
   /**
diff --git a/core/modules/file/src/Tests/FileFieldTestBase.php b/core/modules/file/src/Tests/FileFieldTestBase.php
index 0cf36c3..c82f3a5 100644
--- a/core/modules/file/src/Tests/FileFieldTestBase.php
+++ b/core/modules/file/src/Tests/FileFieldTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\file\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\file\FileInterface;
@@ -207,7 +208,7 @@ function replaceNodeFile($file, $field_name, $nid, $new_revision = TRUE) {
    * Asserts that a file exists physically on disk.
    */
   function assertFileExists($file, $message = NULL) {
-    $message = isset($message) ? $message : format_string('File %file exists on the disk.', array('%file' => $file->getFileUri()));
+    $message = isset($message) ? $message : String::format('File %file exists on the disk.', array('%file' => $file->getFileUri()));
     $this->assertTrue(is_file($file->getFileUri()), $message);
   }
 
@@ -217,7 +218,7 @@ function assertFileExists($file, $message = NULL) {
   function assertFileEntryExists($file, $message = NULL) {
     $this->container->get('entity.manager')->getStorage('file')->resetCache();
     $db_file = file_load($file->id());
-    $message = isset($message) ? $message : format_string('File %file exists in database at the correct path.', array('%file' => $file->getFileUri()));
+    $message = isset($message) ? $message : String::format('File %file exists in database at the correct path.', array('%file' => $file->getFileUri()));
     $this->assertEqual($db_file->getFileUri(), $file->getFileUri(), $message);
   }
 
@@ -225,7 +226,7 @@ function assertFileEntryExists($file, $message = NULL) {
    * Asserts that a file does not exist on disk.
    */
   function assertFileNotExists($file, $message = NULL) {
-    $message = isset($message) ? $message : format_string('File %file exists on the disk.', array('%file' => $file->getFileUri()));
+    $message = isset($message) ? $message : String::format('File %file exists on the disk.', array('%file' => $file->getFileUri()));
     $this->assertFalse(is_file($file->getFileUri()), $message);
   }
 
@@ -234,7 +235,7 @@ function assertFileNotExists($file, $message = NULL) {
    */
   function assertFileEntryNotExists($file, $message) {
     $this->container->get('entity.manager')->getStorage('file')->resetCache();
-    $message = isset($message) ? $message : format_string('File %file exists in database at the correct path.', array('%file' => $file->getFileUri()));
+    $message = isset($message) ? $message : String::format('File %file exists in database at the correct path.', array('%file' => $file->getFileUri()));
     $this->assertFalse(file_load($file->id()), $message);
   }
 
@@ -242,7 +243,7 @@ function assertFileEntryNotExists($file, $message) {
    * Asserts that a file's status is set to permanent in the database.
    */
   function assertFileIsPermanent(FileInterface $file, $message = NULL) {
-    $message = isset($message) ? $message : format_string('File %file is permanent.', array('%file' => $file->getFileUri()));
+    $message = isset($message) ? $message : String::format('File %file is permanent.', array('%file' => $file->getFileUri()));
     $this->assertTrue($file->isPermanent(), $message);
   }
 
diff --git a/core/modules/file/src/Tests/FileFieldValidateTest.php b/core/modules/file/src/Tests/FileFieldValidateTest.php
index 21d93af..40e6eaf 100644
--- a/core/modules/file/src/Tests/FileFieldValidateTest.php
+++ b/core/modules/file/src/Tests/FileFieldValidateTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\file\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\field\Entity\FieldConfig;
 
@@ -40,7 +41,7 @@ function testRequired() {
 
     // Create a new node with the uploaded file.
     $nid = $this->uploadNodeFile($test_file, $field_name, $type_name);
-    $this->assertTrue($nid !== FALSE, format_string('uploadNodeFile(@test_file, @field_name, @type_name) succeeded', array('@test_file' => $test_file->getFileUri(), '@field_name' => $field_name, '@type_name' => $type_name)));
+    $this->assertTrue($nid !== FALSE, String::format('uploadNodeFile(@test_file, @field_name, @type_name) succeeded', array('@test_file' => $test_file->getFileUri(), '@field_name' => $field_name, '@type_name' => $type_name)));
 
     $node_storage->resetCache(array($nid));
     $node = $node_storage->load($nid);
@@ -96,13 +97,13 @@ function testFileMaxSize() {
       $node_storage->resetCache(array($nid));
       $node = $node_storage->load($nid);
       $node_file = file_load($node->{$field_name}->target_id);
-      $this->assertFileExists($node_file, format_string('File exists after uploading a file (%filesize) under the max limit (%maxsize).', array('%filesize' => format_size($small_file->getSize()), '%maxsize' => $max_filesize)));
-      $this->assertFileEntryExists($node_file, format_string('File entry exists after uploading a file (%filesize) under the max limit (%maxsize).', array('%filesize' => format_size($small_file->getSize()), '%maxsize' => $max_filesize)));
+      $this->assertFileExists($node_file, String::format('File exists after uploading a file (%filesize) under the max limit (%maxsize).', array('%filesize' => format_size($small_file->getSize()), '%maxsize' => $max_filesize)));
+      $this->assertFileEntryExists($node_file, String::format('File entry exists after uploading a file (%filesize) under the max limit (%maxsize).', array('%filesize' => format_size($small_file->getSize()), '%maxsize' => $max_filesize)));
 
       // Check that uploading the large file fails (1M limit).
       $this->uploadNodeFile($large_file, $field_name, $type_name);
       $error_message = t('The file is %filesize exceeding the maximum file size of %maxsize.', array('%filesize' => format_size($large_file->getSize()), '%maxsize' => format_size($file_limit)));
-      $this->assertRaw($error_message, format_string('Node save failed when file (%filesize) exceeded the max upload size (%maxsize).', array('%filesize' => format_size($large_file->getSize()), '%maxsize' => $max_filesize)));
+      $this->assertRaw($error_message, String::format('Node save failed when file (%filesize) exceeded the max upload size (%maxsize).', array('%filesize' => format_size($large_file->getSize()), '%maxsize' => $max_filesize)));
     }
 
     // Turn off the max filesize.
@@ -113,8 +114,8 @@ function testFileMaxSize() {
     $node_storage->resetCache(array($nid));
     $node = $node_storage->load($nid);
     $node_file = file_load($node->{$field_name}->target_id);
-    $this->assertFileExists($node_file, format_string('File exists after uploading a file (%filesize) with no max limit.', array('%filesize' => format_size($large_file->getSize()))));
-    $this->assertFileEntryExists($node_file, format_string('File entry exists after uploading a file (%filesize) with no max limit.', array('%filesize' => format_size($large_file->getSize()))));
+    $this->assertFileExists($node_file, String::format('File exists after uploading a file (%filesize) with no max limit.', array('%filesize' => format_size($large_file->getSize()))));
+    $this->assertFileEntryExists($node_file, String::format('File entry exists after uploading a file (%filesize) with no max limit.', array('%filesize' => format_size($large_file->getSize()))));
   }
 
   /**
diff --git a/core/modules/file/src/Tests/FileFieldWidgetTest.php b/core/modules/file/src/Tests/FileFieldWidgetTest.php
index fb3165b..ca5585c 100644
--- a/core/modules/file/src/Tests/FileFieldWidgetTest.php
+++ b/core/modules/file/src/Tests/FileFieldWidgetTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\file\Tests;
 
 use Drupal\comment\Entity\Comment;
+use Drupal\Component\Utility\String;
 use Drupal\field\Entity\FieldConfig;
 
 /**
@@ -136,7 +137,7 @@ function testMultiValuedWidget() {
           // Ensure we have the expected number of Remove buttons, and that they
           // are numbered sequentially.
           $buttons = $this->xpath('//input[@type="submit" and @value="Remove"]');
-          $this->assertTrue(is_array($buttons) && count($buttons) === $num_expected_remove_buttons, format_string('There are %n "Remove" buttons displayed (JSMode=%type).', array('%n' => $num_expected_remove_buttons, '%type' => $type)));
+          $this->assertTrue(is_array($buttons) && count($buttons) === $num_expected_remove_buttons, String::format('There are %n "Remove" buttons displayed (JSMode=%type).', array('%n' => $num_expected_remove_buttons, '%type' => $type)));
           foreach ($buttons as $i => $button) {
             $key = $i >= $remaining ? $i - $remaining : $i;
             $check_field_name = $field_name2;
@@ -178,17 +179,17 @@ function testMultiValuedWidget() {
           // correct name.
           $upload_button_name = $current_field_name . '_' . $remaining . '_upload_button';
           $buttons = $this->xpath('//input[@type="submit" and @value="Upload" and @name=:name]', array(':name' => $upload_button_name));
-          $this->assertTrue(is_array($buttons) && count($buttons) == 1, format_string('The upload button is displayed with the correct name (JSMode=%type).', array('%type' => $type)));
+          $this->assertTrue(is_array($buttons) && count($buttons) == 1, String::format('The upload button is displayed with the correct name (JSMode=%type).', array('%type' => $type)));
 
           // Ensure only at most one button per field is displayed.
           $buttons = $this->xpath('//input[@type="submit" and @value="Upload"]');
           $expected = $current_field_name == $field_name ? 1 : 2;
-          $this->assertTrue(is_array($buttons) && count($buttons) == $expected, format_string('After removing a file, only one "Upload" button for each possible field is displayed (JSMode=%type).', array('%type' => $type)));
+          $this->assertTrue(is_array($buttons) && count($buttons) == $expected, String::format('After removing a file, only one "Upload" button for each possible field is displayed (JSMode=%type).', array('%type' => $type)));
         }
       }
 
       // Ensure the page now has no Remove buttons.
-      $this->assertNoFieldByXPath('//input[@type="submit"]', t('Remove'), format_string('After removing all files, there is no "Remove" button displayed (JSMode=%type).', array('%type' => $type)));
+      $this->assertNoFieldByXPath('//input[@type="submit"]', t('Remove'), String::format('After removing all files, there is no "Remove" button displayed (JSMode=%type).', array('%type' => $type)));
 
       // Save the node and ensure it does not have any files.
       $this->drupalPostForm(NULL, array('title[0][value]' => $this->randomMachineName()), t('Save and publish'));
diff --git a/core/modules/file/src/Tests/FileManagedTestBase.php b/core/modules/file/src/Tests/FileManagedTestBase.php
index 3147f73..3e0ac64 100644
--- a/core/modules/file/src/Tests/FileManagedTestBase.php
+++ b/core/modules/file/src/Tests/FileManagedTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\file\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\file\FileInterface;
 use Drupal\simpletest\WebTestBase;
 
@@ -46,16 +47,16 @@ function assertFileHooksCalled($expected) {
     // Determine if there were any expected that were not called.
     $uncalled = array_diff($expected, $actual);
     if (count($uncalled)) {
-      $this->assertTrue(FALSE, format_string('Expected hooks %expected to be called but %uncalled was not called.', array('%expected' => implode(', ', $expected), '%uncalled' => implode(', ', $uncalled))));
+      $this->assertTrue(FALSE, String::format('Expected hooks %expected to be called but %uncalled was not called.', array('%expected' => implode(', ', $expected), '%uncalled' => implode(', ', $uncalled))));
     }
     else {
-      $this->assertTrue(TRUE, format_string('All the expected hooks were called: %expected', array('%expected' => empty($expected) ? '(none)' : implode(', ', $expected))));
+      $this->assertTrue(TRUE, String::format('All the expected hooks were called: %expected', array('%expected' => empty($expected) ? '(none)' : implode(', ', $expected))));
     }
 
     // Determine if there were any unexpected calls.
     $unexpected = array_diff($actual, $expected);
     if (count($unexpected)) {
-      $this->assertTrue(FALSE, format_string('Unexpected hooks were called: %unexpected.', array('%unexpected' => empty($unexpected) ? '(none)' : implode(', ', $unexpected))));
+      $this->assertTrue(FALSE, String::format('Unexpected hooks were called: %unexpected.', array('%unexpected' => empty($unexpected) ? '(none)' : implode(', ', $unexpected))));
     }
     else {
       $this->assertTrue(TRUE, 'No unexpected hooks were called.');
@@ -77,13 +78,13 @@ function assertFileHookCalled($hook, $expected_count = 1, $message = NULL) {
 
     if (!isset($message)) {
       if ($actual_count == $expected_count) {
-        $message = format_string('hook_file_@name was called correctly.', array('@name' => $hook));
+        $message = String::format('hook_file_@name was called correctly.', array('@name' => $hook));
       }
       elseif ($expected_count == 0) {
         $message = format_plural($actual_count, 'hook_file_@name was not expected to be called but was actually called once.', 'hook_file_@name was not expected to be called but was actually called @count times.', array('@name' => $hook, '@count' => $actual_count));
       }
       else {
-        $message = format_string('hook_file_@name was expected to be called %expected times but was called %actual times.', array('@name' => $hook, '%expected' => $expected_count, '%actual' => $actual_count));
+        $message = String::format('hook_file_@name was expected to be called %expected times but was called %actual times.', array('@name' => $hook, '%expected' => $expected_count, '%actual' => $actual_count));
       }
     }
     $this->assertEqual($actual_count, $expected_count, $message);
diff --git a/core/modules/file/src/Tests/FileManagedUnitTestBase.php b/core/modules/file/src/Tests/FileManagedUnitTestBase.php
index 051601a..172b5b1 100644
--- a/core/modules/file/src/Tests/FileManagedUnitTestBase.php
+++ b/core/modules/file/src/Tests/FileManagedUnitTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\file\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\file\FileInterface;
 use Drupal\simpletest\DrupalUnitTestBase;
 
@@ -58,16 +59,16 @@ function assertFileHooksCalled($expected) {
     // Determine if there were any expected that were not called.
     $uncalled = array_diff($expected, $actual);
     if (count($uncalled)) {
-      $this->assertTrue(FALSE, format_string('Expected hooks %expected to be called but %uncalled was not called.', array('%expected' => implode(', ', $expected), '%uncalled' => implode(', ', $uncalled))));
+      $this->assertTrue(FALSE, String::format('Expected hooks %expected to be called but %uncalled was not called.', array('%expected' => implode(', ', $expected), '%uncalled' => implode(', ', $uncalled))));
     }
     else {
-      $this->assertTrue(TRUE, format_string('All the expected hooks were called: %expected', array('%expected' => empty($expected) ? '(none)' : implode(', ', $expected))));
+      $this->assertTrue(TRUE, String::format('All the expected hooks were called: %expected', array('%expected' => empty($expected) ? '(none)' : implode(', ', $expected))));
     }
 
     // Determine if there were any unexpected calls.
     $unexpected = array_diff($actual, $expected);
     if (count($unexpected)) {
-      $this->assertTrue(FALSE, format_string('Unexpected hooks were called: %unexpected.', array('%unexpected' => empty($unexpected) ? '(none)' : implode(', ', $unexpected))));
+      $this->assertTrue(FALSE, String::format('Unexpected hooks were called: %unexpected.', array('%unexpected' => empty($unexpected) ? '(none)' : implode(', ', $unexpected))));
     }
     else {
       $this->assertTrue(TRUE, 'No unexpected hooks were called.');
@@ -89,13 +90,13 @@ function assertFileHookCalled($hook, $expected_count = 1, $message = NULL) {
 
     if (!isset($message)) {
       if ($actual_count == $expected_count) {
-        $message = format_string('hook_file_@name was called correctly.', array('@name' => $hook));
+        $message = String::format('hook_file_@name was called correctly.', array('@name' => $hook));
       }
       elseif ($expected_count == 0) {
         $message = format_plural($actual_count, 'hook_file_@name was not expected to be called but was actually called once.', 'hook_file_@name was not expected to be called but was actually called @count times.', array('@name' => $hook, '@count' => $actual_count));
       }
       else {
-        $message = format_string('hook_file_@name was expected to be called %expected times but was called %actual times.', array('@name' => $hook, '%expected' => $expected_count, '%actual' => $actual_count));
+        $message = String::format('hook_file_@name was expected to be called %expected times but was called %actual times.', array('@name' => $hook, '%expected' => $expected_count, '%actual' => $actual_count));
       }
     }
     $this->assertEqual($actual_count, $expected_count, $message);
diff --git a/core/modules/file/src/Tests/FileTokenReplaceTest.php b/core/modules/file/src/Tests/FileTokenReplaceTest.php
index 84d599f..6dbb343 100644
--- a/core/modules/file/src/Tests/FileTokenReplaceTest.php
+++ b/core/modules/file/src/Tests/FileTokenReplaceTest.php
@@ -62,7 +62,7 @@ function testFileTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('file' => $file), array('langcode' => $language_interface->getId()));
-      $this->assertEqual($output, $expected, format_string('Sanitized file token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Sanitized file token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test unsanitized tokens.
@@ -73,7 +73,7 @@ function testFileTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('file' => $file), array('langcode' => $language_interface->getId(), 'sanitize' => FALSE));
-      $this->assertEqual($output, $expected, format_string('Unsanitized file token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Unsanitized file token %token replaced.', array('%token' => $input)));
     }
   }
 }
diff --git a/core/modules/file/src/Tests/MoveTest.php b/core/modules/file/src/Tests/MoveTest.php
index 9b1bfc2..60c1fbd 100644
--- a/core/modules/file/src/Tests/MoveTest.php
+++ b/core/modules/file/src/Tests/MoveTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\file\Tests;
+use Drupal\Component\Utility\String;
 
 /**
  * Tests the file move function.
@@ -34,7 +35,7 @@ function testNormal() {
     $this->assertFileHooksCalled(array('move', 'load', 'update'));
 
     // Make sure we got the same file back.
-    $this->assertEqual($source->id(), $result->id(), format_string("Source file id's' %fid is unchanged after move.", array('%fid' => $source->id())));
+    $this->assertEqual($source->id(), $result->id(), String::format("Source file id's' %fid is unchanged after move.", array('%fid' => $source->id())));
 
     // Reload the file from the database and check that the changes were
     // actually saved.
diff --git a/core/modules/filter/src/Tests/FilterAPITest.php b/core/modules/filter/src/Tests/FilterAPITest.php
index 588546e..be4a874 100644
--- a/core/modules/filter/src/Tests/FilterAPITest.php
+++ b/core/modules/filter/src/Tests/FilterAPITest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\filter\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Session\AnonymousUserSession;
 use Drupal\Core\TypedData\OptionsProviderInterface;
 use Drupal\Core\TypedData\DataDefinition;
@@ -384,6 +385,6 @@ public function assertFilterFormatViolation(ConstraintViolationListInterface $vi
         break;
       }
     }
-    $this->assertTrue($filter_format_violation_found, format_string('Validation violation for invalid value "%invalid_value" found', array('%invalid_value' => $invalid_value)));
+    $this->assertTrue($filter_format_violation_found, String::format('Validation violation for invalid value "%invalid_value" found', array('%invalid_value' => $invalid_value)));
   }
 }
diff --git a/core/modules/filter/src/Tests/FilterAdminTest.php b/core/modules/filter/src/Tests/FilterAdminTest.php
index 77d0760..bd3f7a2 100644
--- a/core/modules/filter/src/Tests/FilterAdminTest.php
+++ b/core/modules/filter/src/Tests/FilterAdminTest.php
@@ -127,7 +127,7 @@ function testFormatAdmin() {
     $edit_link = $this->xpath('//a[@href=:href]', array(
       ':href' => \Drupal::url('entity.filter_format.edit_form', ['filter_format' => $format_id])
     ));
-    $this->assertTrue($edit_link, format_string('Link href %href found.',
+    $this->assertTrue($edit_link, String::format('Link href %href found.',
       array('%href' => 'admin/config/content/formats/manage/' . $format_id)
     ));
     $this->drupalGet('admin/config/content/formats/manage/' . $format_id);
diff --git a/core/modules/filter/src/Tests/FilterCrudTest.php b/core/modules/filter/src/Tests/FilterCrudTest.php
index 70ea342..4fa6840 100644
--- a/core/modules/filter/src/Tests/FilterCrudTest.php
+++ b/core/modules/filter/src/Tests/FilterCrudTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\filter\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\KernelTestBase;
 
 /**
@@ -82,11 +83,11 @@ function verifyTextFormat($format) {
 
     // Verify the loaded filter has all properties.
     $filter_format = entity_load('filter_format', $format->format);
-    $this->assertEqual($filter_format->format, $format->format, format_string('filter_format_load: Proper format id for text format %format.', $t_args));
-    $this->assertEqual($filter_format->name, $format->name, format_string('filter_format_load: Proper title for text format %format.', $t_args));
-    $this->assertEqual($filter_format->weight, $format->weight, format_string('filter_format_load: Proper weight for text format %format.', $t_args));
+    $this->assertEqual($filter_format->format, $format->format, String::format('filter_format_load: Proper format id for text format %format.', $t_args));
+    $this->assertEqual($filter_format->name, $format->name, String::format('filter_format_load: Proper title for text format %format.', $t_args));
+    $this->assertEqual($filter_format->weight, $format->weight, String::format('filter_format_load: Proper weight for text format %format.', $t_args));
     // Check that the filter was created in site default language.
-    $this->assertEqual($format->language()->getId(), $default_langcode, format_string('filter_format_load: Proper language code for text format %format.', $t_args));
+    $this->assertEqual($format->language()->getId(), $default_langcode, String::format('filter_format_load: Proper language code for text format %format.', $t_args));
   }
 
 }
diff --git a/core/modules/filter/src/Tests/FilterHtmlImageSecureTest.php b/core/modules/filter/src/Tests/FilterHtmlImageSecureTest.php
index 99d82d3..86e4257 100644
--- a/core/modules/filter/src/Tests/FilterHtmlImageSecureTest.php
+++ b/core/modules/filter/src/Tests/FilterHtmlImageSecureTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\filter\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\StreamWrapper\PublicStream;
 use Drupal\simpletest\WebTestBase;
 
@@ -145,7 +146,7 @@ function testImageSource() {
           $this->assertEqual((string) $element['src'], $converted);
         }
       }
-      $this->assertTrue($found, format_string('@image was found.', array('@image' => $image)));
+      $this->assertTrue($found, String::format('@image was found.', array('@image' => $image)));
     }
   }
 }
diff --git a/core/modules/filter/src/Tests/FilterSettingsTest.php b/core/modules/filter/src/Tests/FilterSettingsTest.php
index b88fcec..c89128c 100644
--- a/core/modules/filter/src/Tests/FilterSettingsTest.php
+++ b/core/modules/filter/src/Tests/FilterSettingsTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\filter\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\KernelTestBase;
 
 /**
@@ -40,7 +41,7 @@ function testFilterDefaults() {
     $saved_settings = array();
     foreach ($filter_defaults_format->filters() as $name => $filter) {
       $expected_weight = $filter_info[$name]['weight'];
-      $this->assertEqual($filter->weight, $expected_weight, format_string('@name filter weight %saved equals %default', array(
+      $this->assertEqual($filter->weight, $expected_weight, String::format('@name filter weight %saved equals %default', array(
         '@name' => $name,
         '%saved' => $filter->weight,
         '%default' => $expected_weight,
@@ -55,7 +56,7 @@ function testFilterDefaults() {
 
     // Verify that saved filter settings have not been changed.
     foreach ($filter_defaults_format->filters() as $name => $filter) {
-      $this->assertEqual($filter->weight, $saved_settings[$name]['weight'], format_string('@name filter weight %saved equals %previous', array(
+      $this->assertEqual($filter->weight, $saved_settings[$name]['weight'], String::format('@name filter weight %saved equals %previous', array(
         '@name' => $name,
         '%saved' => $filter->weight,
         '%previous' => $saved_settings[$name]['weight'],
diff --git a/core/modules/filter/src/Tests/FilterUnitTest.php b/core/modules/filter/src/Tests/FilterUnitTest.php
index 00977ab..479ef63 100644
--- a/core/modules/filter/src/Tests/FilterUnitTest.php
+++ b/core/modules/filter/src/Tests/FilterUnitTest.php
@@ -747,14 +747,14 @@ function assertFilteredString($filter, $tests) {
       foreach ($tasks as $value => $is_expected) {
         // Not using assertIdentical, since combination with strpos() is hard to grok.
         if ($is_expected) {
-          $success = $this->assertTrue(strpos($result, $value) !== FALSE, format_string('@source: @value found. Filtered result: @result.', array(
+          $success = $this->assertTrue(strpos($result, $value) !== FALSE, String::format('@source: @value found. Filtered result: @result.', array(
             '@source' => var_export($source, TRUE),
             '@value' => var_export($value, TRUE),
             '@result' => var_export($result, TRUE),
           )));
         }
         else {
-          $success = $this->assertTrue(strpos($result, $value) === FALSE, format_string('@source: @value not found. Filtered result: @result.', array(
+          $success = $this->assertTrue(strpos($result, $value) === FALSE, String::format('@source: @value not found. Filtered result: @result.', array(
             '@source' => var_export($source, TRUE),
             '@value' => var_export($value, TRUE),
             '@result' => var_export($result, TRUE),
@@ -937,7 +937,7 @@ function testHtmlCorrectorFilter() {
 
 /*--><!]]>*/
 </style></p>',
-      format_string('HTML corrector -- Existing cdata section @pattern_name properly escaped', array('@pattern_name' => '/*<![CDATA[*/'))
+      String::format('HTML corrector -- Existing cdata section @pattern_name properly escaped', array('@pattern_name' => '/*<![CDATA[*/'))
     );
 
     $filtered_data = Html::normalize('<p><style>
@@ -956,7 +956,7 @@ function testHtmlCorrectorFilter() {
 
 /*--><!]]>*/
 </style></p>',
-      format_string('HTML corrector -- Existing cdata section @pattern_name properly escaped', array('@pattern_name' => '<!--/*--><![CDATA[/* ><!--*/'))
+      String::format('HTML corrector -- Existing cdata section @pattern_name properly escaped', array('@pattern_name' => '<!--/*--><![CDATA[/* ><!--*/'))
     );
 
     $filtered_data = Html::normalize('<p><script>
@@ -973,7 +973,7 @@ function testHtmlCorrectorFilter() {
 
 //--><!]]>
 </script></p>',
-      format_string('HTML corrector -- Existing cdata section @pattern_name properly escaped', array('@pattern_name' => '<!--//--><![CDATA[// ><!--'))
+      String::format('HTML corrector -- Existing cdata section @pattern_name properly escaped', array('@pattern_name' => '<!--//--><![CDATA[// ><!--'))
     );
 
     $filtered_data = Html::normalize('<p><script>
@@ -990,7 +990,7 @@ function testHtmlCorrectorFilter() {
 
 //--><!]]>
 </script></p>',
-      format_string('HTML corrector -- Existing cdata section @pattern_name properly escaped', array('@pattern_name' => '// <![CDATA['))
+      String::format('HTML corrector -- Existing cdata section @pattern_name properly escaped', array('@pattern_name' => '// <![CDATA['))
     );
 
   }
diff --git a/core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestPostRenderCache.php b/core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestPostRenderCache.php
index aaeb400..6c26106 100644
--- a/core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestPostRenderCache.php
+++ b/core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestPostRenderCache.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\filter_test\Plugin\Filter;
 
+use Drupal\Component\Utility\String;
 use Drupal\filter\FilterProcessResult;
 use Drupal\filter\Plugin\FilterBase;
 
@@ -51,7 +52,7 @@ public function process($text, $langcode) {
   public static function renderDynamicThing(array $element, array $context) {
     $callback = '\Drupal\filter_test\Plugin\Filter\FilterTestPostRenderCache::renderDynamicThing';
     $placeholder = drupal_render_cache_generate_placeholder($callback, $context);
-    $markup = format_string('This is a dynamic @thing.', array('@thing' => $context['thing']));
+    $markup = String::format('This is a dynamic @thing.', array('@thing' => $context['thing']));
     $element['#markup'] = str_replace($placeholder, $markup, $element['#markup']);
     return $element;
   }
diff --git a/core/modules/forum/src/Tests/ForumBlockTest.php b/core/modules/forum/src/Tests/ForumBlockTest.php
index 78e1c44..5badcbc 100644
--- a/core/modules/forum/src/Tests/ForumBlockTest.php
+++ b/core/modules/forum/src/Tests/ForumBlockTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\forum\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 use Drupal\Core\Datetime\DrupalDateTime;
 
@@ -62,7 +63,7 @@ public function testNewForumTopicsBlock() {
 
     // We expect all 5 forum topics to appear in the "New forum topics" block.
     foreach ($topics as $topic) {
-      $this->assertLink($topic, 0, format_string('Forum topic @topic found in the "New forum topics" block.', array('@topic' => $topic)));
+      $this->assertLink($topic, 0, String::format('Forum topic @topic found in the "New forum topics" block.', array('@topic' => $topic)));
     }
 
     // Configure the new forum topics block to only show 2 topics.
@@ -74,10 +75,10 @@ public function testNewForumTopicsBlock() {
     // topics" block.
     for ($index = 0; $index < 5; $index++) {
       if (in_array($index, array(3, 4))) {
-        $this->assertLink($topics[$index], 0, format_string('Forum topic @topic found in the "New forum topics" block.', array('@topic' => $topics[$index])));
+        $this->assertLink($topics[$index], 0, String::format('Forum topic @topic found in the "New forum topics" block.', array('@topic' => $topics[$index])));
       }
       else {
-        $this->assertNoText($topics[$index], format_string('Forum topic @topic not found in the "New forum topics" block.', array('@topic' => $topics[$index])));
+        $this->assertNoText($topics[$index], String::format('Forum topic @topic not found in the "New forum topics" block.', array('@topic' => $topics[$index])));
       }
     }
   }
@@ -120,10 +121,10 @@ public function testActiveForumTopicsBlock() {
     $this->drupalGet('<front>');
     for ($index = 0; $index < 10; $index++) {
       if ($index < 5) {
-        $this->assertLink($topics[$index], 0, format_string('Forum topic @topic found in the "Active forum topics" block.', array('@topic' => $topics[$index])));
+        $this->assertLink($topics[$index], 0, String::format('Forum topic @topic found in the "Active forum topics" block.', array('@topic' => $topics[$index])));
       }
       else {
-        $this->assertNoText($topics[$index], format_string('Forum topic @topic not found in the "Active forum topics" block.', array('@topic' => $topics[$index])));
+        $this->assertNoText($topics[$index], String::format('Forum topic @topic not found in the "Active forum topics" block.', array('@topic' => $topics[$index])));
       }
     }
 
diff --git a/core/modules/forum/src/Tests/ForumTest.php b/core/modules/forum/src/Tests/ForumTest.php
index 8ebdb81..5ee40d8 100644
--- a/core/modules/forum/src/Tests/ForumTest.php
+++ b/core/modules/forum/src/Tests/ForumTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\forum\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Link;
 use Drupal\simpletest\WebTestBase;
@@ -380,7 +381,7 @@ function createForum($type, $parent = 0) {
         'Created new @type %term.',
         array('%term' => $name, '@type' => t($type))
       ),
-      format_string('@type was created', array('@type' => ucfirst($type)))
+      String::format('@type was created', array('@type' => ucfirst($type)))
     );
 
     // Verify forum.
@@ -508,7 +509,7 @@ function createForumTopic($forum, $container = FALSE) {
 
     // Retrieve node object, ensure that the topic was created and in the proper forum.
     $node = $this->drupalGetNodeByTitle($title);
-    $this->assertTrue($node != NULL, format_string('Node @title was loaded', array('@title' => $title)));
+    $this->assertTrue($node != NULL, String::format('Node @title was loaded', array('@title' => $title)));
     $this->assertEqual($node->taxonomy_forums->target_id, $tid, 'Saved forum topic was in the expected forum');
 
     // View forum topic.
diff --git a/core/modules/help/src/Tests/HelpTest.php b/core/modules/help/src/Tests/HelpTest.php
index 7010f74..0453d75 100644
--- a/core/modules/help/src/Tests/HelpTest.php
+++ b/core/modules/help/src/Tests/HelpTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\help\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -71,7 +72,7 @@ public function testHelp() {
 
     // Make sure links are properly added for modules implementing hook_help().
     foreach ($this->getModuleList() as $module => $name) {
-      $this->assertLink($name, 0, format_string('Link properly added to @name (admin/help/@module)', array('@module' => $module, '@name' => $name)));
+      $this->assertLink($name, 0, String::format('Link properly added to @name (admin/help/@module)', array('@module' => $module, '@name' => $name)));
     }
   }
 
@@ -96,8 +97,8 @@ protected function verifyHelp($response = 200) {
       $this->drupalGet('admin/help/' . $module);
       $this->assertResponse($response);
       if ($response == 200) {
-        $this->assertTitle($name . ' | Drupal', format_string('%module title was displayed', array('%module' => $module)));
-        $this->assertRaw('<h1 class="page-title">' . t($name) . '</h1>', format_string('%module heading was displayed', array('%module' => $module)));
+        $this->assertTitle($name . ' | Drupal', String::format('%module title was displayed', array('%module' => $module)));
+        $this->assertRaw('<h1 class="page-title">' . t($name) . '</h1>', String::format('%module heading was displayed', array('%module' => $module)));
       }
     }
   }
diff --git a/core/modules/image/src/Tests/ImageAdminStylesTest.php b/core/modules/image/src/Tests/ImageAdminStylesTest.php
index 3ecf7c7..a4f2086 100644
--- a/core/modules/image/src/Tests/ImageAdminStylesTest.php
+++ b/core/modules/image/src/Tests/ImageAdminStylesTest.php
@@ -56,7 +56,7 @@ function testNumericStyleName() {
     $this->drupalPostForm('admin/config/media/image-styles/add', $edit, t('Create new style'));
     $this->assertRaw(t('Style %name was created.', array('%name' => $style_label)));
     $options = image_style_options();
-    $this->assertTrue(array_key_exists($style_name, $options), format_string('Array key %key exists.', array('%key' => $style_name)));
+    $this->assertTrue(array_key_exists($style_name, $options), String::format('Array key %key exists.', array('%key' => $style_name)));
   }
 
   /**
@@ -154,7 +154,7 @@ function testStyle() {
 
     // Assert that every effect was saved.
     foreach (array_keys($effect_edits) as $effect_name) {
-      $this->assertTrue(isset($uuids[$effect_name]), format_string(
+      $this->assertTrue(isset($uuids[$effect_name]), String::format(
         'A %effect_name effect was saved with ID %uuid',
         array(
           '%effect_name' => $effect_name,
@@ -193,7 +193,7 @@ function testStyle() {
 
     // Create an image to make sure it gets flushed after saving.
     $image_path = $this->createSampleImage($style);
-    $this->assertEqual($this->getImageCount($style), 1, format_string('Image style %style image %file successfully generated.', array('%style' => $style->label(), '%file' => $image_path)));
+    $this->assertEqual($this->getImageCount($style), 1, String::format('Image style %style image %file successfully generated.', array('%style' => $style->label(), '%file' => $image_path)));
 
     $this->drupalPostForm($style_path, $edit, t('Update style'));
 
@@ -203,12 +203,12 @@ function testStyle() {
     // Check that the URL was updated.
     $this->drupalGet($style_path);
     $this->assertTitle(t('Edit style @name | Drupal', array('@name' => $style_label)));
-    $this->assertResponse(200, format_string('Image style %original renamed to %new', array('%original' => $style->id(), '%new' => $style_name)));
+    $this->assertResponse(200, String::format('Image style %original renamed to %new', array('%original' => $style->id(), '%new' => $style_name)));
 
     // Check that the image was flushed after updating the style.
     // This is especially important when renaming the style. Make sure that
     // the old image directory has been deleted.
-    $this->assertEqual($this->getImageCount($style), 0, format_string('Image style %style was flushed after renaming the style and updating the order of effects.', array('%style' => $style->label())));
+    $this->assertEqual($this->getImageCount($style), 0, String::format('Image style %style was flushed after renaming the style and updating the order of effects.', array('%style' => $style->label())));
 
     // Load the style by the new name with the new weights.
     $style = entity_load('image_style', $style_name);
@@ -229,7 +229,7 @@ function testStyle() {
 
     // Create an image to make sure it gets flushed after deleting an effect.
     $image_path = $this->createSampleImage($style);
-    $this->assertEqual($this->getImageCount($style), 1, format_string('Image style %style image %file successfully generated.', array('%style' => $style->label(), '%file' => $image_path)));
+    $this->assertEqual($this->getImageCount($style), 1, String::format('Image style %style image %file successfully generated.', array('%style' => $style->label(), '%file' => $image_path)));
 
     // Delete the 'image_crop' effect from the style.
     $this->drupalPostForm($style_path . '/effects/' . $uuids['image_crop'] . '/delete', array(), t('Delete'));
@@ -242,7 +242,7 @@ function testStyle() {
     // Refresh the image style information and verify that the effect was
     // actually deleted.
     $style = entity_load_unchanged('image_style', $style->id());
-    $this->assertFalse($style->getEffects()->has($uuids['image_crop']), format_string(
+    $this->assertFalse($style->getEffects()->has($uuids['image_crop']), String::format(
       'Effect with ID %uuid no longer found on image style %style',
       array(
         '%uuid' => $uuids['image_crop'],
@@ -267,9 +267,9 @@ function testStyle() {
 
     // Confirm the style directory has been removed.
     $directory = file_default_scheme() . '://styles/' . $style_name;
-    $this->assertFalse(is_dir($directory), format_string('Image style %style directory removed on style deletion.', array('%style' => $style->label())));
+    $this->assertFalse(is_dir($directory), String::format('Image style %style directory removed on style deletion.', array('%style' => $style->label())));
 
-    $this->assertFalse(entity_load('image_style', $style_name), format_string('Image style %style successfully deleted.', array('%style' => $style->label())));
+    $this->assertFalse(entity_load('image_style', $style_name), String::format('Image style %style successfully deleted.', array('%style' => $style->label())));
 
   }
 
@@ -305,7 +305,7 @@ function testStyleReplacement() {
 
     // Test that image is displayed using newly created style.
     $this->drupalGet('node/' . $nid);
-    $this->assertRaw($style->buildUrl($original_uri), format_string('Image displayed using style @style.', array('@style' => $style_name)));
+    $this->assertRaw($style->buildUrl($original_uri), String::format('Image displayed using style @style.', array('@style' => $style_name)));
 
     // Rename the style and make sure the image field is updated.
     $new_style_name = strtolower($this->randomMachineName(10));
@@ -315,7 +315,7 @@ function testStyleReplacement() {
       'label' => $new_style_label,
     );
     $this->drupalPostForm($style_path . $style_name, $edit, t('Update style'));
-    $this->assertText(t('Changes to the style have been saved.'), format_string('Style %name was renamed to %new_name.', array('%name' => $style_name, '%new_name' => $new_style_name)));
+    $this->assertText(t('Changes to the style have been saved.'), String::format('Style %name was renamed to %new_name.', array('%name' => $style_name, '%new_name' => $new_style_name)));
     $this->drupalGet('node/' . $nid);
 
     // Reload the image style using the new name.
@@ -439,7 +439,7 @@ function testConfigImport() {
 
     // Test that image is displayed using newly created style.
     $this->drupalGet('node/' . $nid);
-    $this->assertRaw($style->buildUrl($original_uri), format_string('Image displayed using style @style.', array('@style' => $style_name)));
+    $this->assertRaw($style->buildUrl($original_uri), String::format('Image displayed using style @style.', array('@style' => $style_name)));
 
     // Copy config to staging, and delete the image style.
     $staging = $this->container->get('config.storage.staging');
diff --git a/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php b/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
index c5dd44d..23065a7 100644
--- a/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
+++ b/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\image\Tests;
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\file\Entity\File;
 
@@ -112,7 +113,7 @@ public function testDefaultImages() {
     $this->assertFieldByXpath(
       '//input[@name="field_storage[settings][default_image][fid][fids]"]',
       $default_images['field']->id(),
-      format_string(
+      String::format(
         'Article image field default equals expected file ID of @fid.',
         array('@fid' => $default_images['field']->id())
       )
@@ -122,7 +123,7 @@ public function testDefaultImages() {
     $this->assertFieldByXpath(
       '//input[@name="field[settings][default_image][fid][fids]"]',
       $default_images['field']->id(),
-      format_string(
+      String::format(
         'Article image field field default equals expected file ID of @fid.',
         array('@fid' => $default_images['field']->id())
       )
@@ -133,7 +134,7 @@ public function testDefaultImages() {
     $this->assertFieldByXpath(
       '//input[@name="field_storage[settings][default_image][fid][fids]"]',
       $default_images['field']->id(),
-      format_string(
+      String::format(
         'Page image field default equals expected file ID of @fid.',
         array('@fid' => $default_images['field']->id())
       )
@@ -144,7 +145,7 @@ public function testDefaultImages() {
     $this->assertFieldByXpath(
       '//input[@name="field[settings][default_image][fid][fids]"]',
       $default_images['field2']->id(),
-      format_string(
+      String::format(
         'Page image field field default equals expected file ID of @fid.',
         array('@fid' => $default_images['field2']->id())
       )
@@ -156,7 +157,7 @@ public function testDefaultImages() {
     $this->assertEqual(
       $article_built[$field_name]['#items'][0]->target_id,
       $default_images['field']->id(),
-      format_string(
+      String::format(
         'A new article node without an image has the expected default image file ID of @fid.',
         array('@fid' => $default_images['field']->id())
       )
@@ -168,7 +169,7 @@ public function testDefaultImages() {
     $this->assertEqual(
       $page_built[$field_name]['#items'][0]->target_id,
       $default_images['field2']->id(),
-      format_string(
+      String::format(
         'A new page node without an image has the expected default image file ID of @fid.',
         array('@fid' => $default_images['field2']->id())
       )
@@ -183,7 +184,7 @@ public function testDefaultImages() {
     $this->assertFieldByXpath(
       '//input[@name="field_storage[settings][default_image][fid][fids]"]',
       $default_images['field_new']->id(),
-      format_string(
+      String::format(
         'Updated image field default equals expected file ID of @fid.',
         array('@fid' => $default_images['field_new']->id())
       )
@@ -196,7 +197,7 @@ public function testDefaultImages() {
     $this->assertEqual(
       $article_built[$field_name]['#items'][0]->target_id,
       $default_images['field']->id(),
-      format_string(
+      String::format(
         'An existing article node without an image has the expected default image file ID of @fid.',
         array('@fid' => $default_images['field']->id())
       )
@@ -204,7 +205,7 @@ public function testDefaultImages() {
     $this->assertEqual(
       $page_built[$field_name]['#items'][0]->target_id,
       $default_images['field2']->id(),
-      format_string(
+      String::format(
         'An existing page node without an image has the expected default image file ID of @fid.',
         array('@fid' => $default_images['field2']->id())
       )
@@ -220,7 +221,7 @@ public function testDefaultImages() {
     $this->assertFieldByXpath(
       '//input[@name="field[settings][default_image][fid][fids]"]',
       $default_images['field_new']->id(),
-      format_string(
+      String::format(
         'Updated article image field field default equals expected file ID of @fid.',
         array('@fid' => $default_images['field_new']->id())
       )
@@ -235,7 +236,7 @@ public function testDefaultImages() {
     $this->assertEqual(
       $article_built[$field_name]['#items'][0]->target_id,
       $default_images['field_new']->id(),
-      format_string(
+      String::format(
         'An existing article node without an image has the expected default image file ID of @fid.',
         array('@fid' => $default_images['field_new']->id())
       )
@@ -244,7 +245,7 @@ public function testDefaultImages() {
     $this->assertEqual(
       $page_built[$field_name]['#items'][0]->target_id,
       $default_images['field2']->id(),
-      format_string(
+      String::format(
         'An existing page node without an image has the expected default image file ID of @fid.',
         array('@fid' => $default_images['field2']->id())
       )
@@ -275,7 +276,7 @@ public function testDefaultImages() {
     $this->assertEqual(
       $article_built[$field_name]['#items'][0]->target_id,
       $default_images['field_new']->id(),
-      format_string(
+      String::format(
         'An existing article node without an image has the expected default image file ID of @fid.',
         array('@fid' => $default_images['field_new']->id())
       )
@@ -284,7 +285,7 @@ public function testDefaultImages() {
     $this->assertEqual(
       $page_built[$field_name]['#items'][0]->target_id,
       $default_images['field2']->id(),
-      format_string(
+      String::format(
         'An existing page node without an image has the expected default image file ID of @fid.',
         array('@fid' => $default_images['field2']->id())
       )
diff --git a/core/modules/image/src/Tests/ImageFieldDisplayTest.php b/core/modules/image/src/Tests/ImageFieldDisplayTest.php
index f6ca758..150c63f 100644
--- a/core/modules/image/src/Tests/ImageFieldDisplayTest.php
+++ b/core/modules/image/src/Tests/ImageFieldDisplayTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\image\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\field\Entity\FieldStorageConfig;
 
@@ -255,7 +256,7 @@ function testImageFieldSettings() {
     $edit = array();
     $edit['files[' . $field_name . '_1][]'] = drupal_realpath($test_image->uri);
     $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published'));
-    $this->assertText(format_string('Article @title has been updated.', array('@title' => $node->getTitle())));
+    $this->assertText(String::format('Article @title has been updated.', array('@title' => $node->getTitle())));
 
     // Assert ImageWidget::process() calls FieldWidget::process().
     $this->drupalGet('node/' . $node->id() . '/edit');
diff --git a/core/modules/image/src/Tests/ImageStyleFlushTest.php b/core/modules/image/src/Tests/ImageStyleFlushTest.php
index 1ebe27b..2449ab7 100644
--- a/core/modules/image/src/Tests/ImageStyleFlushTest.php
+++ b/core/modules/image/src/Tests/ImageStyleFlushTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\image\Tests;
+use Drupal\Component\Utility\String;
 
 /**
  * Tests flushing of image styles.
@@ -85,11 +86,11 @@ function testFlush() {
     $image_path = $this->createSampleImage($style, 'public');
     // Expecting to find 2 images, one is the sample.png image shown in
     // image style preview.
-    $this->assertEqual($this->getImageCount($style, 'public'), 2, format_string('Image style %style image %file successfully generated.', array('%style' => $style->label(), '%file' => $image_path)));
+    $this->assertEqual($this->getImageCount($style, 'public'), 2, String::format('Image style %style image %file successfully generated.', array('%style' => $style->label(), '%file' => $image_path)));
 
     // Create an image for the 'private' wrapper.
     $image_path = $this->createSampleImage($style, 'private');
-    $this->assertEqual($this->getImageCount($style, 'private'), 1, format_string('Image style %style image %file successfully generated.', array('%style' => $style->label(), '%file' => $image_path)));
+    $this->assertEqual($this->getImageCount($style, 'private'), 1, String::format('Image style %style image %file successfully generated.', array('%style' => $style->label(), '%file' => $image_path)));
 
     // Remove the 'image_scale' effect and updates the style, which in turn
     // forces an image style flush.
@@ -104,9 +105,9 @@ function testFlush() {
     $this->assertResponse(200);
 
     // Post flush, expected 1 image in the 'public' wrapper (sample.png).
-    $this->assertEqual($this->getImageCount($style, 'public'), 1, format_string('Image style %style flushed correctly for %wrapper wrapper.', array('%style' => $style->label(), '%wrapper' => 'public')));
+    $this->assertEqual($this->getImageCount($style, 'public'), 1, String::format('Image style %style flushed correctly for %wrapper wrapper.', array('%style' => $style->label(), '%wrapper' => 'public')));
 
     // Post flush, expected no image in the 'private' wrapper.
-    $this->assertEqual($this->getImageCount($style, 'private'), 0, format_string('Image style %style flushed correctly for %wrapper wrapper.', array('%style' => $style->label(), '%wrapper' => 'private')));
+    $this->assertEqual($this->getImageCount($style, 'private'), 0, String::format('Image style %style flushed correctly for %wrapper wrapper.', array('%style' => $style->label(), '%wrapper' => 'private')));
   }
 }
diff --git a/core/modules/language/src/Tests/LanguageBrowserDetectionUnitTest.php b/core/modules/language/src/Tests/LanguageBrowserDetectionUnitTest.php
index f724338..980d845 100644
--- a/core/modules/language/src/Tests/LanguageBrowserDetectionUnitTest.php
+++ b/core/modules/language/src/Tests/LanguageBrowserDetectionUnitTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\language\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\UserAgent;
 use Drupal\Core\Language\Language;
 use Drupal\simpletest\WebTestBase;
@@ -152,7 +153,7 @@ function testLanguageFromBrowser() {
     $mappings = $this->container->get('config.factory')->get('language.mappings')->get();
     foreach ($test_cases as $accept_language => $expected_result) {
       $result = UserAgent::getBestMatchingLangcode($accept_language, array_keys($languages), $mappings);
-      $this->assertIdentical($result, $expected_result, format_string("Language selection '@accept-language' selects '@result', result = '@actual'", array('@accept-language' => $accept_language, '@result' => $expected_result, '@actual' => isset($result) ? $result : 'none')));
+      $this->assertIdentical($result, $expected_result, String::format("Language selection '@accept-language' selects '@result', result = '@actual'", array('@accept-language' => $accept_language, '@result' => $expected_result, '@actual' => isset($result) ? $result : 'none')));
     }
   }
 
diff --git a/core/modules/language/src/Tests/LanguageConfigurationTest.php b/core/modules/language/src/Tests/LanguageConfigurationTest.php
index 32f70e6..e9d7a2f 100644
--- a/core/modules/language/src/Tests/LanguageConfigurationTest.php
+++ b/core/modules/language/src/Tests/LanguageConfigurationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\language\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\simpletest\WebTestBase;
 
@@ -157,7 +158,7 @@ protected function checkConfigurableLanguageWeight($state = 'by default') {
     $replacements = array('@event' => $state);
     foreach (\Drupal::languageManager()->getLanguages(LanguageInterface::STATE_LOCKED) as $locked_language) {
       $replacements['%language'] = $locked_language->getName();
-      $this->assertTrue($locked_language->getWeight() > $max_configurable_language_weight, format_string('System language %language has higher weight than configurable languages @event', $replacements));
+      $this->assertTrue($locked_language->getWeight() > $max_configurable_language_weight, String::format('System language %language has higher weight than configurable languages @event', $replacements));
     }
   }
 
diff --git a/core/modules/language/src/Tests/LanguageDependencyInjectionTest.php b/core/modules/language/src/Tests/LanguageDependencyInjectionTest.php
index b6fc729..d9374c6 100644
--- a/core/modules/language/src/Tests/LanguageDependencyInjectionTest.php
+++ b/core/modules/language/src/Tests/LanguageDependencyInjectionTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\language\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Language\Language;
 use Drupal\language\Entity\ConfigurableLanguage;
@@ -29,7 +30,7 @@ function testDependencyInjectedNewLanguage() {
     $expected = $this->languageManager->getDefaultLanguage();
     $result = $this->languageManager->getCurrentLanguage();
     foreach ($expected as $property => $value) {
-      $this->assertEqual($expected->$property, $result->$property, format_string('The dependency injected language object %prop property equals the new Language object %prop property.', array('%prop' => $property)));
+      $this->assertEqual($expected->$property, $result->$property, String::format('The dependency injected language object %prop property equals the new Language object %prop property.', array('%prop' => $property)));
     }
   }
 
diff --git a/core/modules/language/src/Tests/LanguageNegotiationInfoTest.php b/core/modules/language/src/Tests/LanguageNegotiationInfoTest.php
index 9125d05..d4a72c6 100644
--- a/core/modules/language/src/Tests/LanguageNegotiationInfoTest.php
+++ b/core/modules/language/src/Tests/LanguageNegotiationInfoTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\language\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUI;
 use Drupal\simpletest\WebTestBase;
@@ -117,10 +118,10 @@ function testInfoAlterations() {
     foreach ($this->languageManager()->getLanguageTypes() as $type) {
       $form_field = $type . '[enabled][test_language_negotiation_method_ts]';
       if ($type == $test_type) {
-        $this->assertFieldByName($form_field, NULL, format_string('Type-specific test language negotiation method available for %type.', array('%type' => $type)));
+        $this->assertFieldByName($form_field, NULL, String::format('Type-specific test language negotiation method available for %type.', array('%type' => $type)));
       }
       else {
-        $this->assertNoFieldByName($form_field, NULL, format_string('Type-specific test language negotiation method unavailable for %type.', array('%type' => $type)));
+        $this->assertNoFieldByName($form_field, NULL, String::format('Type-specific test language negotiation method unavailable for %type.', array('%type' => $type)));
       }
     }
 
@@ -130,7 +131,7 @@ function testInfoAlterations() {
     foreach ($this->languageManager()->getDefinedLanguageTypes() as $type) {
       $langcode = $last[$type];
       $value = $type == LanguageInterface::TYPE_CONTENT || strpos($type, 'test') !== FALSE ? 'it' : 'en';
-      $this->assertEqual($langcode, $value, format_string('The negotiated language for %type is %language', array('%type' => $type, '%language' => $value)));
+      $this->assertEqual($langcode, $value, String::format('The negotiated language for %type is %language', array('%type' => $type, '%language' => $value)));
     }
 
     // Uninstall language_test and check that everything is set back to the
@@ -140,7 +141,7 @@ function testInfoAlterations() {
 
     // Check that only the core language types are available.
     foreach ($this->languageManager()->getDefinedLanguageTypes() as $type) {
-      $this->assertTrue(strpos($type, 'test') === FALSE, format_string('The %type language is still available', array('%type' => $type)));
+      $this->assertTrue(strpos($type, 'test') === FALSE, String::format('The %type language is still available', array('%type' => $type)));
     }
 
     // Check that fixed language types are properly configured, even those
@@ -170,7 +171,7 @@ protected function checkFixedLanguageTypes() {
           list(, $info_id) = each($info['fixed']);
           $equal = $info_id == $id;
         }
-        $this->assertTrue($equal, format_string('language negotiation for %type is properly set up', array('%type' => $type)));
+        $this->assertTrue($equal, String::format('language negotiation for %type is properly set up', array('%type' => $type)));
       }
     }
   }
diff --git a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
index 440ee36..1f0258e 100644
--- a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
+++ b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\language\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationBrowser;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationSelected;
@@ -465,7 +466,7 @@ function testLanguageDomain() {
     $italian_url = _url('admin', array('language' => $languages['it'], 'script' => ''));
     $url_scheme = \Drupal::request()->isSecure() ? 'https://' : 'http://';
     $correct_link = $url_scheme . $link;
-    $this->assertEqual($italian_url, $correct_link, format_string('The _url() function returns the right URL (@url) in accordance with the chosen language', array('@url' => $italian_url)));
+    $this->assertEqual($italian_url, $correct_link, String::format('The _url() function returns the right URL (@url) in accordance with the chosen language', array('@url' => $italian_url)));
 
     // Test HTTPS via options.
     $this->settingsSet('mixed_mode_sessions', TRUE);
@@ -473,7 +474,7 @@ function testLanguageDomain() {
 
     $italian_url = _url('admin', array('https' => TRUE, 'language' => $languages['it'], 'script' => ''));
     $correct_link = 'https://' . $link;
-    $this->assertTrue($italian_url == $correct_link, format_string('The _url() function returns the right HTTPS URL (via options) (@url) in accordance with the chosen language', array('@url' => $italian_url)));
+    $this->assertTrue($italian_url == $correct_link, String::format('The _url() function returns the right HTTPS URL (via options) (@url) in accordance with the chosen language', array('@url' => $italian_url)));
     $this->settingsSet('mixed_mode_sessions', FALSE);
 
     // Test HTTPS via current URL scheme.
@@ -482,7 +483,7 @@ function testLanguageDomain() {
     $generator = $this->container->get('url_generator');
     $italian_url = _url('admin', array('language' => $languages['it'], 'script' => ''));
     $correct_link = 'https://' . $link;
-    $this->assertTrue($italian_url == $correct_link, format_string('The _url() function returns the right URL (via current URL scheme) (@url) in accordance with the chosen language', array('@url' => $italian_url)));
+    $this->assertTrue($italian_url == $correct_link, String::format('The _url() function returns the right URL (via current URL scheme) (@url) in accordance with the chosen language', array('@url' => $italian_url)));
   }
 
   /**
diff --git a/core/modules/locale/src/StringBase.php b/core/modules/locale/src/StringBase.php
index 39fe7f1..cdf2f4f 100644
--- a/core/modules/locale/src/StringBase.php
+++ b/core/modules/locale/src/StringBase.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\locale;
+use Drupal\Component\Utility\String;
 
 /**
  * Defines the locale string base class.
@@ -188,7 +189,7 @@ public function save() {
       $storage->save($this);
     }
     else {
-      throw new StringStorageException(format_string('The string cannot be saved because its not bound to a storage: @string', array(
+      throw new StringStorageException(String::format('The string cannot be saved because its not bound to a storage: @string', array(
         '@string' => $string->getString(),
       )));
     }
@@ -204,7 +205,7 @@ public function delete() {
         $storage->delete($this);
       }
       else {
-        throw new StringStorageException(format_string('The string cannot be deleted because its not bound to a storage: @string', array(
+        throw new StringStorageException(String::format('The string cannot be deleted because its not bound to a storage: @string', array(
           '@string' => $string->getString(),
         )));
       }
diff --git a/core/modules/locale/src/StringDatabaseStorage.php b/core/modules/locale/src/StringDatabaseStorage.php
index ea4f12e..c2166ab 100644
--- a/core/modules/locale/src/StringDatabaseStorage.php
+++ b/core/modules/locale/src/StringDatabaseStorage.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\locale;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Database\Connection;
 
 /**
@@ -198,7 +199,7 @@ public function delete($string) {
       }
     }
     else {
-      throw new StringStorageException(format_string('The string cannot be deleted because it lacks some key fields: @string', array(
+      throw new StringStorageException(String::format('The string cannot be deleted because it lacks some key fields: @string', array(
         '@string' => $string->getString(),
       )));
     }
@@ -481,7 +482,7 @@ protected function dbStringInsert($string) {
         ->execute();
     }
     else {
-      throw new StringStorageException(format_string('The string cannot be saved: @string', array(
+      throw new StringStorageException(String::format('The string cannot be saved: @string', array(
           '@string' => $string->getString(),
       )));
     }
@@ -514,7 +515,7 @@ protected function dbStringUpdate($string) {
         ->execute();
     }
     else {
-      throw new StringStorageException(format_string('The string cannot be updated: @string', array(
+      throw new StringStorageException(String::format('The string cannot be updated: @string', array(
           '@string' => $string->getString(),
       )));
     }
diff --git a/core/modules/locale/src/Tests/LocaleImportFunctionalTest.php b/core/modules/locale/src/Tests/LocaleImportFunctionalTest.php
index 1995214..5f8268a 100644
--- a/core/modules/locale/src/Tests/LocaleImportFunctionalTest.php
+++ b/core/modules/locale/src/Tests/LocaleImportFunctionalTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\locale\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 use Drupal\Core\Language\LanguageInterface;
 
@@ -324,7 +325,7 @@ public function testConfigPoFile() {
         'translation' => 'all',
       );
       $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
-      $this->assertText($config_string[1], format_string('Translation of @string found.', array('@string' => $config_string[0])));
+      $this->assertText($config_string[1], String::format('Translation of @string found.', array('@string' => $config_string[0])));
     }
 
     // Test that translations got recorded in the config system.
diff --git a/core/modules/locale/src/Tests/LocaleStringTest.php b/core/modules/locale/src/Tests/LocaleStringTest.php
index 430b024..d2f3f63 100644
--- a/core/modules/locale/src/Tests/LocaleStringTest.php
+++ b/core/modules/locale/src/Tests/LocaleStringTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\locale\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\simpletest\WebTestBase;
 
@@ -51,7 +52,7 @@ public function testStringCRUDAPI() {
     // Create source string.
     $source = $this->buildSourceString();
     $source->save();
-    $this->assertTrue($source->lid, format_string('Successfully created string %string', array('%string' => $source->source)));
+    $this->assertTrue($source->lid, String::format('Successfully created string %string', array('%string' => $source->source)));
 
     // Load strings by lid and source.
     $string1 = $this->storage->findString(array('lid' => $source->lid));
diff --git a/core/modules/locale/src/Tests/LocaleUpdateBase.php b/core/modules/locale/src/Tests/LocaleUpdateBase.php
index 37d4d78..86dfca9 100644
--- a/core/modules/locale/src/Tests/LocaleUpdateBase.php
+++ b/core/modules/locale/src/Tests/LocaleUpdateBase.php
@@ -300,6 +300,6 @@ protected function setCurrentTranslations() {
   protected function assertTranslation($source, $translation, $langcode, $message = '') {
     $db_translation = db_query('SELECT translation FROM {locales_target} lt INNER JOIN {locales_source} ls ON ls.lid = lt.lid WHERE ls.source = :source AND lt.language = :langcode', array(':source' => $source, ':langcode' => $langcode))->fetchField();
     $db_translation = $db_translation == FALSE ? '' : $db_translation;
-    $this->assertEqual($translation, $db_translation, $message ? $message : format_string('Correct translation of %source (%language)', array('%source' => $source, '%language' => $langcode)));
+    $this->assertEqual($translation, $db_translation, $message ? $message : String::format('Correct translation of %source (%language)', array('%source' => $source, '%language' => $langcode)));
   }
 }
diff --git a/core/modules/locale/src/Tests/LocaleUpdateTest.php b/core/modules/locale/src/Tests/LocaleUpdateTest.php
index ed0203e..7e4dda8 100644
--- a/core/modules/locale/src/Tests/LocaleUpdateTest.php
+++ b/core/modules/locale/src/Tests/LocaleUpdateTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\locale\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\LanguageInterface;
 
 /**
@@ -47,7 +48,7 @@ public function testUpdateProjects() {
     $projects = locale_translation_project_list();
     $this->assertFalse(isset($projects['locale_test_translate']), 'Hidden module not found');
     $this->assertEqual($projects['locale_test']['info']['interface translation server pattern'], 'core/modules/locale/test/test.%language.po', 'Interface translation parameter found in project info.');
-    $this->assertEqual($projects['locale_test']['name'], 'locale_test', format_string('%key found in project info.', array('%key' => 'interface translation project')));
+    $this->assertEqual($projects['locale_test']['name'], 'locale_test', String::format('%key found in project info.', array('%key' => 'interface translation project')));
   }
 
   /**
diff --git a/core/modules/menu_ui/src/Tests/MenuTest.php b/core/modules/menu_ui/src/Tests/MenuTest.php
index 2864593..9e62fc6 100644
--- a/core/modules/menu_ui/src/Tests/MenuTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\menu_ui\Tests;
 
 use Drupal\Component\Serialization\Json;
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Menu\MenuLinkInterface;
 use Drupal\menu_link_content\Entity\MenuLinkContent;
@@ -524,7 +525,7 @@ public function testBlockContextualLinks() {
 
     $id = 'block:block=' . $block->id() . ':|menu:menu=tools:';
     // @see \Drupal\contextual\Tests\ContextualDynamicContextTest:assertContextualLinkPlaceHolder()
-    $this->assertRaw('<div data-contextual-id="'. $id . '"></div>', format_string('Contextual link placeholder with id @id exists.', array('@id' => $id)));
+    $this->assertRaw('<div data-contextual-id="'. $id . '"></div>', String::format('Contextual link placeholder with id @id exists.', array('@id' => $id)));
 
     // Get server-rendered contextual links.
     // @see \Drupal\contextual\Tests\ContextualDynamicContextTest:renderContextualLinks()
diff --git a/core/modules/node/src/Tests/NodeAccessRecordsTest.php b/core/modules/node/src/Tests/NodeAccessRecordsTest.php
index 4b019c8..c7cbfe3 100644
--- a/core/modules/node/src/Tests/NodeAccessRecordsTest.php
+++ b/core/modules/node/src/Tests/NodeAccessRecordsTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\node\Entity\Node;
 
 /**
@@ -76,7 +77,7 @@ function testNodeAccessRecords() {
       $grants = node_test_node_grants($web_user, $op);
       $altered_grants = $grants;
       \Drupal::moduleHandler()->alter('node_grants', $altered_grants, $web_user, $op);
-      $this->assertNotEqual($grants, $altered_grants, format_string('Altered the %op grant for a user.', array('%op' => $op)));
+      $this->assertNotEqual($grants, $altered_grants, String::format('Altered the %op grant for a user.', array('%op' => $op)));
     }
 
     // Check that core does not grant access to an unpublished node when an
diff --git a/core/modules/node/src/Tests/NodeLoadMultipleTest.php b/core/modules/node/src/Tests/NodeLoadMultipleTest.php
index afb1d30..035e3e1 100644
--- a/core/modules/node/src/Tests/NodeLoadMultipleTest.php
+++ b/core/modules/node/src/Tests/NodeLoadMultipleTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\node\Entity\Node;
 
 /**
@@ -50,12 +51,12 @@ function testNodeMultipleLoad() {
     $this->assertEqual($node3->label(), $nodes[$node3->id()]->label(), 'Node was loaded.');
     $this->assertEqual($node4->label(), $nodes[$node4->id()]->label(), 'Node was loaded.');
     $count = count($nodes);
-    $this->assertTrue($count == 2, format_string('@count nodes loaded.', array('@count' => $count)));
+    $this->assertTrue($count == 2, String::format('@count nodes loaded.', array('@count' => $count)));
 
     // Load nodes by nid. Nodes 1, 2 and 4 will be loaded.
     $nodes = Node::loadMultiple(array(1, 2, 4));
     $count = count($nodes);
-    $this->assertTrue(count($nodes) == 3, format_string('@count nodes loaded', array('@count' => $count)));
+    $this->assertTrue(count($nodes) == 3, String::format('@count nodes loaded', array('@count' => $count)));
     $this->assertTrue(isset($nodes[$node1->id()]), 'Node is correctly keyed in the array');
     $this->assertTrue(isset($nodes[$node2->id()]), 'Node is correctly keyed in the array');
     $this->assertTrue(isset($nodes[$node4->id()]), 'Node is correctly keyed in the array');
diff --git a/core/modules/node/src/Tests/NodeTestBase.php b/core/modules/node/src/Tests/NodeTestBase.php
index 764d0a8..5948e75 100644
--- a/core/modules/node/src/Tests/NodeTestBase.php
+++ b/core/modules/node/src/Tests/NodeTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\simpletest\WebTestBase;
 
@@ -102,7 +103,7 @@ function assertNodeCreateAccess($bundle, $result, AccountInterface $account, $la
    * @return string
    */
   function nodeAccessAssertMessage($operation, $result, $langcode = NULL) {
-    return format_string(
+    return String::format(
       'Node access returns @result with operation %op, language code %langcode.',
       array(
         '@result' => $result ? 'true' : 'false',
diff --git a/core/modules/node/src/Tests/NodeTokenReplaceTest.php b/core/modules/node/src/Tests/NodeTokenReplaceTest.php
index 7c0dfe7..b447b91 100644
--- a/core/modules/node/src/Tests/NodeTokenReplaceTest.php
+++ b/core/modules/node/src/Tests/NodeTokenReplaceTest.php
@@ -81,7 +81,7 @@ function testNodeTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $this->tokenService->replace($input, array('node' => $node), array('langcode' => $this->interfaceLanguage->getId()));
-      $this->assertEqual($output, $expected, format_string('Sanitized node token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Sanitized node token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test unsanitized tokens.
@@ -93,7 +93,7 @@ function testNodeTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $this->tokenService->replace($input, array('node' => $node), array('langcode' => $this->interfaceLanguage->getId(), 'sanitize' => FALSE));
-      $this->assertEqual($output, $expected, format_string('Unsanitized node token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Unsanitized node token %token replaced.', array('%token' => $input)));
     }
 
     // Repeat for a node without a summary.
@@ -114,7 +114,7 @@ function testNodeTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $this->tokenService->replace($input, array('node' => $node), array('language' => $this->interfaceLanguage));
-      $this->assertEqual($output, $expected, format_string('Sanitized node token %token replaced for node without a summary.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Sanitized node token %token replaced for node without a summary.', array('%token' => $input)));
     }
 
     // Generate and test unsanitized tokens.
@@ -122,7 +122,7 @@ function testNodeTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $this->tokenService->replace($input, array('node' => $node), array('language' => $this->interfaceLanguage, 'sanitize' => FALSE));
-      $this->assertEqual($output, $expected, format_string('Unsanitized node token %token replaced for node without a summary.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Unsanitized node token %token replaced for node without a summary.', array('%token' => $input)));
     }
   }
 
diff --git a/core/modules/node/src/Tests/NodeTranslationUITest.php b/core/modules/node/src/Tests/NodeTranslationUITest.php
index b5fd27a..ab6726d 100644
--- a/core/modules/node/src/Tests/NodeTranslationUITest.php
+++ b/core/modules/node/src/Tests/NodeTranslationUITest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\content_translation\Tests\ContentTranslationUITest;
 use Drupal\Core\Language\LanguageInterface;
@@ -322,7 +323,7 @@ protected function doTestTranslations($path, array $values) {
     $languages = $this->container->get('language_manager')->getLanguages();
     foreach ($this->langcodes as $langcode) {
       $this->drupalGet($path, array('language' => $languages[$langcode]));
-      $this->assertText($values[$langcode]['title'][0]['value'], format_string('The %langcode node translation is correctly displayed.', array('%langcode' => $langcode)));
+      $this->assertText($values[$langcode]['title'][0]['value'], String::format('The %langcode node translation is correctly displayed.', array('%langcode' => $langcode)));
     }
   }
 
@@ -343,7 +344,7 @@ protected function doTestAlternateHreflangLinks($path) {
         // Retrieve desired link elements from the HTML head.
         $links = $this->xpath('head/link[@rel = "alternate" and @href = :href and @hreflang = :hreflang]',
           array(':href' => $url, ':hreflang' => $alternate_langcode));
-        $this->assert(isset($links[0]), format_string('The %langcode node translation has the correct alternate hreflang link for %alternate_langcode: %link.', array('%langcode' => $langcode, '%alternate_langcode' => $alternate_langcode, '%link' => $url)));
+        $this->assert(isset($links[0]), String::format('The %langcode node translation has the correct alternate hreflang link for %alternate_langcode: %link.', array('%langcode' => $langcode, '%alternate_langcode' => $alternate_langcode, '%link' => $url)));
       }
     }
   }
diff --git a/core/modules/node/src/Tests/NodeTypeTest.php b/core/modules/node/src/Tests/NodeTypeTest.php
index 23b692d..f43ed62 100644
--- a/core/modules/node/src/Tests/NodeTypeTest.php
+++ b/core/modules/node/src/Tests/NodeTypeTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\node\Tests;
+use Drupal\Component\Utility\String;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\node\Entity\NodeType;
 
@@ -130,8 +131,8 @@ function testNodeTypeStatus() {
     $this->container->get('module_handler')->install(array('book'), FALSE);
     $types = node_type_get_types();
     foreach (array('book', 'article', 'page') as $type) {
-      $this->assertTrue(isset($types[$type]), format_string('%type is found in node types.', array('%type' => $type)));
-      $this->assertFalse($types[$type]->isLocked(), format_string('%type type is not locked.', array('%type' => $type)));
+      $this->assertTrue(isset($types[$type]), String::format('%type is found in node types.', array('%type' => $type)));
+      $this->assertFalse($types[$type]->isLocked(), String::format('%type type is not locked.', array('%type' => $type)));
     }
 
     // Disable book module and the respective type should still be active, since
@@ -146,8 +147,8 @@ function testNodeTypeStatus() {
     $this->container->get('module_handler')->install(array('book'), FALSE);
     $types = node_type_get_types();
     foreach (array('book', 'article', 'page') as $type) {
-      $this->assertTrue(isset($types[$type]), format_string('%type is found in node types.', array('%type' => $type)));
-      $this->assertFalse($types[$type]->isLocked(), format_string('%type type is not locked.', array('%type' => $type)));
+      $this->assertTrue(isset($types[$type]), String::format('%type is found in node types.', array('%type' => $type)));
+      $this->assertFalse($types[$type]->isLocked(), String::format('%type type is not locked.', array('%type' => $type)));
     }
   }
 
diff --git a/core/modules/node/src/Tests/Views/FrontPageTest.php b/core/modules/node/src/Tests/Views/FrontPageTest.php
index ebb7347..75829d5 100644
--- a/core/modules/node/src/Tests/Views/FrontPageTest.php
+++ b/core/modules/node/src/Tests/Views/FrontPageTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Tests\Views;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Tests\ViewTestBase;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Views;
@@ -53,7 +54,7 @@ public function testFrontPage() {
     $this->executeView($view);
     $view->preview();
 
-    $this->assertEqual($view->getTitle(), format_string('Welcome to @site_name', array('@site_name' => $site_name)), 'The welcome title is used for the empty view.');
+    $this->assertEqual($view->getTitle(), String::format('Welcome to @site_name', array('@site_name' => $site_name)), 'The welcome title is used for the empty view.');
     $view->destroy();
 
     // Create some nodes on the frontpage view. Add more than 10 nodes in order
diff --git a/core/modules/options/src/Tests/OptionsFieldUITest.php b/core/modules/options/src/Tests/OptionsFieldUITest.php
index 40343bf..c19ed01 100644
--- a/core/modules/options/src/Tests/OptionsFieldUITest.php
+++ b/core/modules/options/src/Tests/OptionsFieldUITest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\options\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\field\Tests\FieldTestBase;
 
@@ -306,7 +307,7 @@ function testNodeDisplay() {
     );
 
     $this->drupalPostForm($this->admin_path, $edit, t('Save field settings'));
-    $this->assertText(format_string('Updated field !field_name field settings.', array('!field_name' => $this->field_name)), "The 'On' and 'Off' form fields work for boolean fields.");
+    $this->assertText(String::format('Updated field !field_name field settings.', array('!field_name' => $this->field_name)), "The 'On' and 'Off' form fields work for boolean fields.");
 
     // Select a default value.
     $edit = array(
diff --git a/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php b/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php
index e7c98c6..f43a471 100644
--- a/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php
+++ b/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\search\Tests;
+use Drupal\Component\Utility\String;
 
 /**
  * Verify the search config settings form.
@@ -204,7 +205,7 @@ function testSearchModuleDisabling() {
       $this->drupalGet($item['path'], $item['options']);
       foreach ($plugins as $entity_id) {
         $label = $entities[$entity_id]->label();
-        $this->assertText($label, format_string('%label search tab is shown', array('%label' => $label)));
+        $this->assertText($label, String::format('%label search tab is shown', array('%label' => $label)));
       }
     }
   }
diff --git a/core/modules/search/src/Tests/SearchNumberMatchingTest.php b/core/modules/search/src/Tests/SearchNumberMatchingTest.php
index 330d8a7..ea931ad 100644
--- a/core/modules/search/src/Tests/SearchNumberMatchingTest.php
+++ b/core/modules/search/src/Tests/SearchNumberMatchingTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\search\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\LanguageInterface;
 
 /**
@@ -66,7 +67,7 @@ function testNumberSearching() {
       $this->drupalPostForm('search/node',
         array('keys' => 'foo'),
         t('Search'));
-      $this->assertNoText($node->label(), format_string('%number: node title not shown in dummy search', array('%number' => $i)));
+      $this->assertNoText($node->label(), String::format('%number: node title not shown in dummy search', array('%number' => $i)));
 
       // Now verify that we can find node i by searching for any of the
       // numbers.
@@ -79,7 +80,7 @@ function testNumberSearching() {
         $this->drupalPostForm('search/node',
           array('keys' => $number),
           t('Search'));
-        $this->assertText($node->label(), format_string('%i: node title shown (search found the node) in search for number %number', array('%i' => $i, '%number' => $number)));
+        $this->assertText($node->label(), String::format('%i: node title shown (search found the node) in search for number %number', array('%i' => $i, '%number' => $number)));
       }
     }
 
diff --git a/core/modules/search/src/Tests/SearchNumbersTest.php b/core/modules/search/src/Tests/SearchNumbersTest.php
index 3747db7..fd65fe2 100644
--- a/core/modules/search/src/Tests/SearchNumbersTest.php
+++ b/core/modules/search/src/Tests/SearchNumbersTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\search\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\LanguageInterface;
 
 /**
@@ -86,7 +87,7 @@ function testNumberSearching() {
       $this->drupalPostForm('search/node',
         array('keys' => $number),
         t('Search'));
-      $this->assertText($node->label(), format_string('%type: node title shown (search found the node) in search for number %number.', array('%type' => $type, '%number' => $number)));
+      $this->assertText($node->label(), String::format('%type: node title shown (search found the node) in search for number %number.', array('%type' => $type, '%number' => $number)));
     }
   }
 }
diff --git a/core/modules/search/src/Tests/SearchTestBase.php b/core/modules/search/src/Tests/SearchTestBase.php
index bac6974..1264602 100644
--- a/core/modules/search/src/Tests/SearchTestBase.php
+++ b/core/modules/search/src/Tests/SearchTestBase.php
@@ -89,8 +89,8 @@ protected function submitGetForm($path, $edit, $submit, $form_html_id = NULL) {
       foreach ($edit as $name => $value) {
         $this->fail(String::format('Failed to set field @name to @value', array('@name' => $name, '@value' => $value)));
       }
-      $this->assertTrue($submit_matches, format_string('Found the @submit button', array('@submit' => $submit)));
-      $this->fail(format_string('Found the requested form fields at @path', array('@path' => $path)));
+      $this->assertTrue($submit_matches, String::format('Found the @submit button', array('@submit' => $submit)));
+      $this->fail(String::format('Found the requested form fields at @path', array('@path' => $path)));
     }
   }
 }
diff --git a/core/modules/shortcut/src/Tests/ShortcutLinksTest.php b/core/modules/shortcut/src/Tests/ShortcutLinksTest.php
index dffdd48..821f527 100644
--- a/core/modules/shortcut/src/Tests/ShortcutLinksTest.php
+++ b/core/modules/shortcut/src/Tests/ShortcutLinksTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\shortcut\Tests;
+use Drupal\Component\Utility\String;
 use Drupal\shortcut\Entity\Shortcut;
 use Drupal\shortcut\Entity\ShortcutSet;
 
@@ -284,7 +285,7 @@ private function verifyAccessShortcutsPermissionForEditPages() {
 
     foreach ($edit_paths as $path) {
       $this->drupalGet($path);
-      $message = format_string('Access is denied on %s', array('%s' => $path));
+      $message = String::format('Access is denied on %s', array('%s' => $path));
       $this->assertResponse(403, $message);
     }
   }
diff --git a/core/modules/shortcut/src/Tests/ShortcutSetsTest.php b/core/modules/shortcut/src/Tests/ShortcutSetsTest.php
index 66713dc..add47d2 100644
--- a/core/modules/shortcut/src/Tests/ShortcutSetsTest.php
+++ b/core/modules/shortcut/src/Tests/ShortcutSetsTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\shortcut\Tests;
+use Drupal\Component\Utility\String;
 use Drupal\shortcut\Entity\ShortcutSet;
 
 /**
@@ -158,7 +159,7 @@ function testShortcutSetRenameAlreadyExists() {
     $this->drupalPostForm('admin/config/user-interface/shortcut/manage/' . $set->id(), array('label' => $existing_label), t('Save'));
     $this->assertRaw(t('The shortcut set %name already exists. Choose another name.', array('%name' => $existing_label)));
     $set = ShortcutSet::load($set->id());
-    $this->assertNotEqual($set->label(), $existing_label, format_string('The shortcut set %title cannot be renamed to %new-title because a shortcut set with that title already exists.', array('%title' => $set->label(), '%new-title' => $existing_label)));
+    $this->assertNotEqual($set->label(), $existing_label, String::format('The shortcut set %title cannot be renamed to %new-title because a shortcut set with that title already exists.', array('%title' => $set->label(), '%new-title' => $existing_label)));
   }
 
   /**
diff --git a/core/modules/shortcut/src/Tests/ShortcutTranslationUITest.php b/core/modules/shortcut/src/Tests/ShortcutTranslationUITest.php
index 453e465..f7bc5f9 100644
--- a/core/modules/shortcut/src/Tests/ShortcutTranslationUITest.php
+++ b/core/modules/shortcut/src/Tests/ShortcutTranslationUITest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\shortcut\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\content_translation\Tests\ContentTranslationUITest;
 use Drupal\Core\Language\Language;
 
@@ -73,7 +74,7 @@ protected function doTestBasicTranslation() {
         $expected_path = \Drupal::urlGenerator()->generateFromRoute('user.page', array(), array('language' => $language));
         $label = $entity->getTranslation($langcode)->label();
         $elements = $this->xpath('//nav[contains(@class, "toolbar-lining")]/ul[@class="menu"]/li/a[contains(@href, :href) and normalize-space(text())=:label]', array(':href' => $expected_path, ':label' => $label));
-        $this->assertTrue(!empty($elements), format_string('Translated @language shortcut link @label found.', array('@label' => $label, '@language' => $language->getName())));
+        $this->assertTrue(!empty($elements), String::format('Translated @language shortcut link @label found.', array('@label' => $label, '@language' => $language->getName())));
       }
     }
   }
diff --git a/core/modules/simpletest/src/AssertContentTrait.php b/core/modules/simpletest/src/AssertContentTrait.php
index 5fdafdf..d2b3ab1 100644
--- a/core/modules/simpletest/src/AssertContentTrait.php
+++ b/core/modules/simpletest/src/AssertContentTrait.php
@@ -272,8 +272,9 @@ protected function getAllOptions(\SimpleXMLElement $element) {
    *   Link position counting from zero.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The gorup this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -296,8 +297,9 @@ protected function assertLink($label, $index = 0, $message = '', $group = 'Other
    *   Text between the anchor tags.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -322,8 +324,9 @@ protected function assertNoLink($label, $message = '', $group = 'Other') {
    *   Link position counting from zero.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -346,8 +349,9 @@ protected function assertLinkByHref($href, $index = 0, $message = '', $group = '
    *   The full or partial value of the 'href' attribute of the anchor tag.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -372,8 +376,9 @@ protected function assertNoLinkByHref($href, $message = '', $group = 'Other') {
    *   Raw (HTML) string to look for.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -399,8 +404,9 @@ protected function assertRaw($raw, $message = '', $group = 'Other') {
    *   Raw (HTML) string to look for.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -426,8 +432,9 @@ protected function assertNoRaw($raw, $message = '', $group = 'Other') {
    *   Raw (HTML) string to look for.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -454,8 +461,9 @@ protected function assertEscaped($raw, $message = '', $group = 'Other') {
    *   Raw (HTML) string to look for.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -483,8 +491,9 @@ protected function assertNoEscaped($raw, $message = '', $group = 'Other') {
    *   Plain text to look for.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -509,8 +518,9 @@ protected function assertText($text, $message = '', $group = 'Other') {
    *   Plain text to look for.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -533,8 +543,9 @@ protected function assertNoText($text, $message = '', $group = 'Other') {
    *   Plain text to look for.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -565,8 +576,9 @@ protected function assertTextHelper($text, $message = '', $group = 'Other', $not
    *   Plain text to look for.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -591,8 +603,9 @@ protected function assertUniqueText($text, $message = '', $group = 'Other') {
    *   Plain text to look for.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -615,8 +628,9 @@ protected function assertNoUniqueText($text, $message = '', $group = 'Other') {
    *   Plain text to look for.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -649,8 +663,9 @@ protected function assertUniqueTextHelper($text, $message = '', $group = 'Other'
    *   Perl regex to look for including the regex delimiters.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -674,8 +689,9 @@ protected function assertPattern($pattern, $message = '', $group = 'Other') {
    *   Perl regex to look for including the regex delimiters.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -722,8 +738,9 @@ protected function assertTextPattern($pattern, $message = NULL, $group = 'Other'
    *   The string the title should be.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -751,8 +768,9 @@ protected function assertTitle($title, $message = '', $group = 'Other') {
    *   The string the title should not be.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -784,8 +802,9 @@ protected function assertNoTitle($title, $message = '', $group = 'Other') {
    *   The expected themed output string.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -805,7 +824,7 @@ protected function assertThemeOutput($callback, array $variables = array(), $exp
     if (!$message) {
       $message = '%callback rendered correctly.';
     }
-    $message = format_string($message, array('%callback' => 'theme_' . $callback . '()'));
+    $message = String::format($message, array('%callback' => 'theme_' . $callback . '()'));
     return $this->assertIdentical($output, $expected, $message, $group);
   }
 
@@ -820,8 +839,9 @@ protected function assertThemeOutput($callback, array $variables = array(), $exp
    *   exists.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -901,8 +921,9 @@ protected function getSelectedItem(\SimpleXMLElement $element) {
    *   page does not match it.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -941,8 +962,9 @@ protected function assertNoFieldByXPath($xpath, $value = NULL, $message = '', $g
    *   exists.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -981,8 +1003,9 @@ protected function assertFieldByName($name, $value = NULL, $message = NULL, $gro
    *   default value ('') asserts that the field value is not an empty string.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -1008,8 +1031,9 @@ protected function assertNoFieldByName($name, $value = '', $message = '', $group
    *   string.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -1035,8 +1059,9 @@ protected function assertFieldById($id, $value = '', $message = '', $group = 'Br
    *   value ('') asserts that the field value is not an empty string.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -1057,8 +1082,9 @@ protected function assertNoFieldById($id, $value = '', $message = '', $group = '
    *   ID of field to assert.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -1080,8 +1106,9 @@ protected function assertFieldChecked($id, $message = '', $group = 'Browser') {
    *   ID of field to assert.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -1105,8 +1132,9 @@ protected function assertNoFieldChecked($id, $message = '', $group = 'Browser')
    *   Option to assert.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -1130,8 +1158,9 @@ protected function assertOption($id, $option, $message = '', $group = 'Browser')
    *   Option to assert.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -1156,8 +1185,9 @@ protected function assertNoOption($id, $option, $message = '', $group = 'Browser
    *   Option to assert.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -1183,8 +1213,9 @@ protected function assertOptionSelected($id, $option, $message = '', $group = 'B
    *   Option to assert.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -1206,8 +1237,9 @@ protected function assertNoOptionSelected($id, $option, $message = '', $group =
    *   Name or ID of field to assert.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -1228,8 +1260,9 @@ protected function assertField($field, $message = '', $group = 'Other') {
    *   Name or ID of field to assert.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -1248,8 +1281,9 @@ protected function assertNoField($field, $message = '', $group = 'Other') {
    *
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php
index d947caa..f20dc38 100644
--- a/core/modules/simpletest/src/KernelTestBase.php
+++ b/core/modules/simpletest/src/KernelTestBase.php
@@ -333,13 +333,13 @@ public function containerBuild(ContainerBuilder $container) {
   protected function installConfig(array $modules) {
     foreach ($modules as $module) {
       if (!$this->container->get('module_handler')->moduleExists($module)) {
-        throw new \RuntimeException(format_string("'@module' module is not enabled.", array(
+        throw new \RuntimeException(String::format("'@module' module is not enabled.", array(
           '@module' => $module,
         )));
       }
       \Drupal::service('config.installer')->installDefaultConfig('module', $module);
     }
-    $this->pass(format_string('Installed default config: %modules.', array(
+    $this->pass(String::format('Installed default config: %modules.', array(
       '%modules' => implode(', ', $modules),
     )));
   }
@@ -363,7 +363,7 @@ protected function installSchema($module, $tables) {
     // behavior and non-reproducible test failures, we only allow the schema of
     // explicitly loaded/enabled modules to be installed.
     if (!$this->container->get('module_handler')->moduleExists($module)) {
-      throw new \RuntimeException(format_string("'@module' module is not enabled.", array(
+      throw new \RuntimeException(String::format("'@module' module is not enabled.", array(
         '@module' => $module,
       )));
     }
@@ -371,7 +371,7 @@ protected function installSchema($module, $tables) {
     foreach ($tables as $table) {
       $schema = drupal_get_schema_unprocessed($module, $table);
       if (empty($schema)) {
-        throw new \RuntimeException(format_string("Unknown '@table' table schema in '@module' module.", array(
+        throw new \RuntimeException(String::format("Unknown '@table' table schema in '@module' module.", array(
           '@module' => $module,
           '@table' => $table,
         )));
@@ -382,7 +382,7 @@ protected function installSchema($module, $tables) {
     // would not know of/return the schema otherwise.
     // @todo Refactor Schema API to make this obsolete.
     drupal_get_schema(NULL, TRUE);
-    $this->pass(format_string('Installed %module tables: %tables.', array(
+    $this->pass(String::format('Installed %module tables: %tables.', array(
       '%tables' => '{' . implode('}, {', $tables) . '}',
       '%module' => $module,
     )));
@@ -459,7 +459,7 @@ protected function enableModules(array $modules) {
     // Note that the kernel has rebuilt the container; this $module_handler is
     // no longer the $module_handler instance from above.
     $this->container->get('module_handler')->reload();
-    $this->pass(format_string('Enabled modules: %modules.', array(
+    $this->pass(String::format('Enabled modules: %modules.', array(
       '%modules' => implode(', ', $modules),
     )));
   }
@@ -493,7 +493,7 @@ protected function disableModules(array $modules) {
     // no longer the $module_handler instance from above.
     $module_handler = $this->container->get('module_handler');
     $module_handler->reload();
-    $this->pass(format_string('Disabled modules: %modules.', array(
+    $this->pass(String::format('Disabled modules: %modules.', array(
       '%modules' => implode(', ', $modules),
     )));
   }
diff --git a/core/modules/simpletest/src/Tests/MailCaptureTest.php b/core/modules/simpletest/src/Tests/MailCaptureTest.php
index e8999a4..12d20fc 100644
--- a/core/modules/simpletest/src/Tests/MailCaptureTest.php
+++ b/core/modules/simpletest/src/Tests/MailCaptureTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\simpletest\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -45,7 +46,7 @@ function testMailSend() {
     // Assert that the email was sent by iterating over the message properties
     // and ensuring that they are captured intact.
     foreach ($message as $field => $value) {
-      $this->assertMail($field, $value, format_string('The email was sent and the value for property @field is intact.', array('@field' => $field)), 'Email');
+      $this->assertMail($field, $value, String::format('The email was sent and the value for property @field is intact.', array('@field' => $field)), 'Email');
     }
 
     // Send additional emails so more than one email is captured.
diff --git a/core/modules/simpletest/src/Tests/SimpleTestTest.php b/core/modules/simpletest/src/Tests/SimpleTestTest.php
index d2949a6..b7fde63 100644
--- a/core/modules/simpletest/src/Tests/SimpleTestTest.php
+++ b/core/modules/simpletest/src/Tests/SimpleTestTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\simpletest\Tests;
 
 use Drupal\Component\Utility\Crypt;
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -277,7 +278,7 @@ function assertAssertion($message, $type, $status, $file, $function) {
         break;
       }
     }
-    return $this->assertTrue($found, format_string('Found assertion {"@message", "@type", "@status", "@file", "@function"}.', array('@message' => $message, '@type' => $type, '@status' => $status, "@file" => $file, "@function" => $function)));
+    return $this->assertTrue($found, String::format('Found assertion {"@message", "@type", "@status", "@file", "@function"}.', array('@message' => $message, '@type' => $type, '@status' => $status, "@file" => $file, "@function" => $function)));
   }
 
   /**
diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php
index a8568d6..249d780 100644
--- a/core/modules/simpletest/src/WebTestBase.php
+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -403,7 +403,7 @@ protected function drupalPlaceBlock($plugin_id, array $settings = array()) {
    */
   protected function assertBlockAppears(Block $block) {
     $result = $this->findBlockInstance($block);
-    $this->assertTrue(!empty($result), format_string('Ensure the block @id appears on the page', array('@id' => $block->id())));
+    $this->assertTrue(!empty($result), String::format('Ensure the block @id appears on the page', array('@id' => $block->id())));
   }
 
   /**
@@ -414,7 +414,7 @@ protected function assertBlockAppears(Block $block) {
    */
   protected function assertNoBlockAppears(Block $block) {
     $result = $this->findBlockInstance($block);
-    $this->assertFalse(!empty($result), format_string('Ensure the block @id does not appear on the page', array('@id' => $block->id())));
+    $this->assertFalse(!empty($result), String::format('Ensure the block @id does not appear on the page', array('@id' => $block->id())));
   }
 
   /**
@@ -679,7 +679,7 @@ protected function drupalLogin(AccountInterface $account) {
     if (isset($this->session_id)) {
       $account->session_id = $this->session_id;
     }
-    $pass = $this->assert($this->drupalUserIsLoggedIn($account), format_string('User %name successfully logged in.', array('%name' => $account->getUsername())), 'User login');
+    $pass = $this->assert($this->drupalUserIsLoggedIn($account), String::format('User %name successfully logged in.', array('%name' => $account->getUsername())), 'User login');
     if ($pass) {
       $this->loggedInUser = $account;
       $this->container->get('current_user')->setAccount($account);
@@ -1688,9 +1688,9 @@ protected function drupalPostForm($path, $edit, $submit, array $options = array(
         $this->fail(String::format('Failed to set field @name to @value', array('@name' => $name, '@value' => $value)));
       }
       if (!$ajax && isset($submit)) {
-        $this->assertTrue($submit_matches, format_string('Found the @submit button', array('@submit' => $submit)));
+        $this->assertTrue($submit_matches, String::format('Found the @submit button', array('@submit' => $submit)));
       }
-      $this->fail(format_string('Found the requested form fields at @path', array('@path' => $path)));
+      $this->fail(String::format('Found the requested form fields at @path', array('@path' => $path)));
     }
   }
 
@@ -2486,8 +2486,8 @@ protected function drupalSetSettings($settings) {
    *   (optional) Any additional options to pass for $path to the url generator.
    * @param $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use String::format() to embed variables in the message text,
+   *   not t(). If left blank, a default message will be displayed.
    * @param $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -2520,8 +2520,8 @@ protected function assertUrl($path, array $options = array(), $message = '', $gr
    *   of all codes see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.
    * @param $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use String::format() to embed variables in the message text,
+   *   not t(). If left blank, a default message will be displayed.
    * @param $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -2545,8 +2545,8 @@ protected function assertResponse($code, $message = '', $group = 'Browser') {
    *   of all codes see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.
    * @param $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use String::format() to embed variables in the message text,
+   *   not t(). If left blank, a default message will be displayed.
    * @param $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -2574,8 +2574,8 @@ protected function assertNoResponse($code, $message = '', $group = 'Browser') {
    *   Value of the field to assert.
    * @param $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use String::format() to embed variables in the message text,
+   *   not t(). If left blank, a default message will be displayed.
    * @param $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -2602,8 +2602,8 @@ protected function assertMail($name, $value = '', $message = '', $group = 'Email
    *   Number of emails to search for string, starting with most recent.
    * @param $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use String::format() to embed variables in the message text,
+   *   not t(). If left blank, a default message will be displayed.
    * @param $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -2628,7 +2628,7 @@ protected function assertMailString($field_name, $string, $email_depth, $message
       }
     }
     if (!$message) {
-      $message = format_string('Expected text found in @field of email message: "@expected".', array('@field' => $field_name, '@expected' => $string));
+      $message = String::format('Expected text found in @field of email message: "@expected".', array('@field' => $field_name, '@expected' => $string));
     }
     return $this->assertTrue($string_found, $message, $group);
   }
@@ -2642,8 +2642,8 @@ protected function assertMailString($field_name, $string, $email_depth, $message
    *   Pattern to search for.
    * @param $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use String::format() to embed variables in the message text,
+   *   not t(). If left blank, a default message will be displayed.
    * @param $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -2658,7 +2658,7 @@ protected function assertMailPattern($field_name, $regex, $message = '', $group
     $mail = end($mails);
     $regex_found = preg_match("/$regex/", $mail[$field_name]);
     if (!$message) {
-      $message = format_string('Expected text found in @field of email message: "@expected".', array('@field' => $field_name, '@expected' => $regex));
+      $message = String::format('Expected text found in @field of email message: "@expected".', array('@field' => $field_name, '@expected' => $regex));
     }
     return $this->assertTrue($regex_found, $message, $group);
   }
diff --git a/core/modules/statistics/src/Tests/StatisticsTokenReplaceTest.php b/core/modules/statistics/src/Tests/StatisticsTokenReplaceTest.php
index d481f01..93e4cd0 100644
--- a/core/modules/statistics/src/Tests/StatisticsTokenReplaceTest.php
+++ b/core/modules/statistics/src/Tests/StatisticsTokenReplaceTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\statistics\Tests;
+use Drupal\Component\Utility\String;
 
 /**
  * Generates text using placeholders for dummy content to check statistics token
@@ -50,7 +51,7 @@ function testStatisticsTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = \Drupal::token()->replace($input, array('node' => $node), array('langcode' => $language_interface->getId()));
-      $this->assertEqual($output, $expected, format_string('Statistics token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Statistics token %token replaced.', array('%token' => $input)));
     }
   }
 }
diff --git a/core/modules/system/src/Tests/Ajax/FrameworkTest.php b/core/modules/system/src/Tests/Ajax/FrameworkTest.php
index d52e243..e67e118 100644
--- a/core/modules/system/src/Tests/Ajax/FrameworkTest.php
+++ b/core/modules/system/src/Tests/Ajax/FrameworkTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Ajax;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Ajax\AddCssCommand;
 use Drupal\Core\Ajax\AlertCommand;
 use Drupal\Core\Ajax\AppendCommand;
@@ -144,9 +145,9 @@ public function testLazyLoad() {
 
     // Verify that the base page doesn't have the settings and files that are to
     // be lazy loaded as part of the next requests.
-    $this->assertTrue(!isset($original_settings[$expected['setting_name']]), format_string('Page originally lacks the %setting, as expected.', array('%setting' => $expected['setting_name'])));
-    $this->assertTrue(!isset($original_css[$expected['css']]), format_string('Page originally lacks the %css file, as expected.', array('%css' => $expected['css'])));
-    $this->assertTrue(!isset($original_js[$expected['js']]), format_string('Page originally lacks the %js file, as expected.', array('%js' => $expected['js'])));
+    $this->assertTrue(!isset($original_settings[$expected['setting_name']]), String::format('Page originally lacks the %setting, as expected.', array('%setting' => $expected['setting_name'])));
+    $this->assertTrue(!isset($original_css[$expected['css']]), String::format('Page originally lacks the %css file, as expected.', array('%css' => $expected['css'])));
+    $this->assertTrue(!isset($original_js[$expected['js']]), String::format('Page originally lacks the %js file, as expected.', array('%js' => $expected['js'])));
 
     // Submit the AJAX request without triggering files getting added.
     $commands = $this->drupalPostAjaxForm(NULL, array('add_files' => FALSE), array('op' => t('Submit')));
@@ -155,9 +156,9 @@ public function testLazyLoad() {
     $new_js = $new_settings['ajaxPageState']['js'];
 
     // Verify the setting was not added when not expected.
-    $this->assertTrue(!isset($new_settings[$expected['setting_name']]), format_string('Page still lacks the %setting, as expected.', array('%setting' => $expected['setting_name'])));
-    $this->assertTrue(!isset($new_css[$expected['css']]), format_string('Page still lacks the %css file, as expected.', array('%css' => $expected['css'])));
-    $this->assertTrue(!isset($new_js[$expected['js']]), format_string('Page still lacks the %js file, as expected.', array('%js' => $expected['js'])));
+    $this->assertTrue(!isset($new_settings[$expected['setting_name']]), String::format('Page still lacks the %setting, as expected.', array('%setting' => $expected['setting_name'])));
+    $this->assertTrue(!isset($new_css[$expected['css']]), String::format('Page still lacks the %css file, as expected.', array('%css' => $expected['css'])));
+    $this->assertTrue(!isset($new_js[$expected['js']]), String::format('Page still lacks the %js file, as expected.', array('%js' => $expected['js'])));
     // Verify a settings command does not add CSS or scripts to drupalSettings
     // and no command inserts the corresponding tags on the page.
     $found_settings_command = FALSE;
@@ -170,8 +171,8 @@ public function testLazyLoad() {
         $found_markup_command = TRUE;
       }
     }
-    $this->assertFalse($found_settings_command, format_string('Page state still lacks the %css and %js files, as expected.', array('%css' => $expected['css'], '%js' => $expected['js'])));
-    $this->assertFalse($found_markup_command, format_string('Page still lacks the %css and %js files, as expected.', array('%css' => $expected['css'], '%js' => $expected['js'])));
+    $this->assertFalse($found_settings_command, String::format('Page state still lacks the %css and %js files, as expected.', array('%css' => $expected['css'], '%js' => $expected['js'])));
+    $this->assertFalse($found_markup_command, String::format('Page still lacks the %css and %js files, as expected.', array('%css' => $expected['css'], '%js' => $expected['js'])));
 
     // Submit the AJAX request and trigger adding files.
     $commands = $this->drupalPostAjaxForm(NULL, array('add_files' => TRUE), array('op' => t('Submit')));
@@ -181,14 +182,14 @@ public function testLazyLoad() {
 
     // Verify the expected setting was added, both to drupalSettings, and as
     // the first AJAX command.
-    $this->assertIdentical($new_settings[$expected['setting_name']], $expected['setting_value'], format_string('Page now has the %setting.', array('%setting' => $expected['setting_name'])));
+    $this->assertIdentical($new_settings[$expected['setting_name']], $expected['setting_value'], String::format('Page now has the %setting.', array('%setting' => $expected['setting_name'])));
     $expected_command = new SettingsCommand(array($expected['setting_name'] => $expected['setting_value']), TRUE);
-    $this->assertCommand(array_slice($commands, 0, 1), $expected_command->render(), format_string('The settings command was first.'));
+    $this->assertCommand(array_slice($commands, 0, 1), $expected_command->render(), String::format('The settings command was first.'));
 
     // Verify the expected CSS file was added, both to drupalSettings, and as
     // the second AJAX command for inclusion into the HTML.
-    $this->assertEqual($new_css, $original_css + array($expected_css_basename => 1), format_string('Page state now has the %css file.', array('%css' => $expected['css'])));
-    $this->assertCommand(array_slice($commands, 1, 1), array('data' => $expected_css_html), format_string('Page now has the %css file.', array('%css' => $expected['css'])));
+    $this->assertEqual($new_css, $original_css + array($expected_css_basename => 1), String::format('Page state now has the %css file.', array('%css' => $expected['css'])));
+    $this->assertCommand(array_slice($commands, 1, 1), array('data' => $expected_css_html), String::format('Page now has the %css file.', array('%css' => $expected['css'])));
 
     // Verify the expected JS file was added, both to drupalSettings, and as
     // the third AJAX command for inclusion into the HTML. By testing for an
@@ -196,8 +197,8 @@ public function testLazyLoad() {
     // unexpected JavaScript code, such as a jQuery.extend() that would
     // potentially clobber rather than properly merge settings, didn't
     // accidentally get added.
-    $this->assertEqual($new_js, $original_js + array($expected['js'] => 1), format_string('Page state now has the %js file.', array('%js' => $expected['js'])));
-    $this->assertCommand(array_slice($commands, 2, 1), array('data' => $expected_js_html), format_string('Page now has the %js file.', array('%js' => $expected['js'])));
+    $this->assertEqual($new_js, $original_js + array($expected['js'] => 1), String::format('Page state now has the %js file.', array('%js' => $expected['js'])));
+    $this->assertCommand(array_slice($commands, 2, 1), array('data' => $expected_js_html), String::format('Page now has the %js file.', array('%js' => $expected['js'])));
   }
 
   /**
diff --git a/core/modules/system/src/Tests/Block/SystemMenuBlockTest.php b/core/modules/system/src/Tests/Block/SystemMenuBlockTest.php
index ce5b81b..c88be3a 100644
--- a/core/modules/system/src/Tests/Block/SystemMenuBlockTest.php
+++ b/core/modules/system/src/Tests/Block/SystemMenuBlockTest.php
@@ -5,6 +5,7 @@
 
 namespace Drupal\system\Tests\Block;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Render\Element;
 use Drupal\simpletest\KernelTestBase;
 use Drupal\system\Tests\Routing\MockRouteProvider;
@@ -229,7 +230,7 @@ public function testConfigLevelDepth() {
     foreach ($blocks as $id => $block) {
       $block_build = $block->build();
       $items = isset($block_build['#items']) ? $block_build['#items'] : [];
-      $this->assertIdentical($no_active_trail_expectations[$id], $this->convertBuiltMenuToIdTree($items), format_string('Menu block %id with no active trail renders the expected tree.', ['%id' => $id]));
+      $this->assertIdentical($no_active_trail_expectations[$id], $this->convertBuiltMenuToIdTree($items), String::format('Menu block %id with no active trail renders the expected tree.', ['%id' => $id]));
     }
 
     // Scenario 2: test all block instances when there's an active trail.
@@ -277,7 +278,7 @@ public function testConfigLevelDepth() {
     foreach ($blocks as $id => $block) {
       $block_build = $block->build();
       $items = isset($block_build['#items']) ? $block_build['#items'] : [];
-      $this->assertIdentical($active_trail_expectations[$id], $this->convertBuiltMenuToIdTree($items), format_string('Menu block %id with an active trail renders the expected tree.', ['%id' => $id]));
+      $this->assertIdentical($active_trail_expectations[$id], $this->convertBuiltMenuToIdTree($items), String::format('Menu block %id with an active trail renders the expected tree.', ['%id' => $id]));
     }
   }
 
diff --git a/core/modules/system/src/Tests/Cache/ClearTest.php b/core/modules/system/src/Tests/Cache/ClearTest.php
index 1a152ed..6175268 100644
--- a/core/modules/system/src/Tests/Cache/ClearTest.php
+++ b/core/modules/system/src/Tests/Cache/ClearTest.php
@@ -12,6 +12,7 @@
  *
  * @group Cache
  */
+use Drupal\Component\Utility\String;
 use Drupal\Core\Cache\Cache;
 
 class ClearTest extends CacheTestBase {
@@ -40,7 +41,7 @@ function testFlushAllCaches() {
 
     foreach ($bins as $bin => $cache_backend) {
       $cid = 'test_cid_clear' . $bin;
-      $this->assertFalse($this->checkCacheExists($cid, $this->default_value, $bin), format_string('All cache entries removed from @bin.', array('@bin' => $bin)));
+      $this->assertFalse($this->checkCacheExists($cid, $this->default_value, $bin), String::format('All cache entries removed from @bin.', array('@bin' => $bin)));
     }
   }
 }
diff --git a/core/modules/system/src/Tests/Common/AddFeedTest.php b/core/modules/system/src/Tests/Common/AddFeedTest.php
index 0f5a560..caf8bc7 100644
--- a/core/modules/system/src/Tests/Common/AddFeedTest.php
+++ b/core/modules/system/src/Tests/Common/AddFeedTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Common;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -64,7 +65,7 @@ function testBasicFeedAddNoTitle() {
 
     $this->drupalSetContent(drupal_get_html_head());
     foreach ($urls as $description => $feed_info) {
-      $this->assertPattern($this->urlToRSSLinkPattern($feed_info['url'], $feed_info['title']), format_string('Found correct feed header for %description', array('%description' => $description)));
+      $this->assertPattern($this->urlToRSSLinkPattern($feed_info['url'], $feed_info['title']), String::format('Found correct feed header for %description', array('%description' => $description)));
     }
   }
 
diff --git a/core/modules/system/src/Tests/Common/RenderWebTest.php b/core/modules/system/src/Tests/Common/RenderWebTest.php
index c2cb88f..70d1e31 100644
--- a/core/modules/system/src/Tests/Common/RenderWebTest.php
+++ b/core/modules/system/src/Tests/Common/RenderWebTest.php
@@ -155,7 +155,7 @@ protected function assertRenderedElement(array $element, $xpath, array $xpath_ar
     // @see \Drupal\simpletest\WebTestBase::xpath()
     $xpath = $this->buildXPathQuery($xpath, $xpath_args);
     $element += array('#value' => NULL);
-    $this->assertFieldByXPath($xpath, $element['#value'], format_string('#type @type was properly rendered.', array(
+    $this->assertFieldByXPath($xpath, $element['#value'], String::format('#type @type was properly rendered.', array(
       '@type' => var_export($element['#type'], TRUE),
     )));
   }
diff --git a/core/modules/system/src/Tests/Common/SimpleTestErrorCollectorTest.php b/core/modules/system/src/Tests/Common/SimpleTestErrorCollectorTest.php
index ae419ff..ee65d00 100644
--- a/core/modules/system/src/Tests/Common/SimpleTestErrorCollectorTest.php
+++ b/core/modules/system/src/Tests/Common/SimpleTestErrorCollectorTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Common;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -88,11 +89,11 @@ protected function error($message = '', $group = 'Other', array $caller = NULL)
    * Asserts that a collected error matches what we are expecting.
    */
   function assertError($error, $group, $function, $file, $message = NULL) {
-    $this->assertEqual($error['group'], $group, format_string("Group was %group", array('%group' => $group)));
-    $this->assertEqual($error['caller']['function'], $function, format_string("Function was %function", array('%function' => $function)));
-    $this->assertEqual(drupal_basename($error['caller']['file']), $file, format_string("File was %file", array('%file' => $file)));
+    $this->assertEqual($error['group'], $group, String::format("Group was %group", array('%group' => $group)));
+    $this->assertEqual($error['caller']['function'], $function, String::format("Function was %function", array('%function' => $function)));
+    $this->assertEqual(drupal_basename($error['caller']['file']), $file, String::format("File was %file", array('%file' => $file)));
     if (isset($message)) {
-      $this->assertEqual($error['message'], $message, format_string("Message was %message", array('%message' => $message)));
+      $this->assertEqual($error['message'], $message, String::format("Message was %message", array('%message' => $message)));
     }
   }
 }
diff --git a/core/modules/system/src/Tests/Common/SystemListingTest.php b/core/modules/system/src/Tests/Common/SystemListingTest.php
index fc1cebf..983ceec 100644
--- a/core/modules/system/src/Tests/Common/SystemListingTest.php
+++ b/core/modules/system/src/Tests/Common/SystemListingTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Common;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Extension\ExtensionDiscovery;
 use Drupal\simpletest\DrupalUnitTestBase;
 
@@ -37,7 +38,7 @@ function testDirectoryPrecedence() {
     foreach ($expected_directories as $module => $directories) {
       foreach ($directories as $directory) {
         $filename = "$directory/$module/$module.info.yml";
-        $this->assertTrue(file_exists(DRUPAL_ROOT . '/' . $filename), format_string('@filename exists.', array('@filename' => $filename)));
+        $this->assertTrue(file_exists(DRUPAL_ROOT . '/' . $filename), String::format('@filename exists.', array('@filename' => $filename)));
       }
     }
 
@@ -49,7 +50,7 @@ function testDirectoryPrecedence() {
     foreach ($expected_directories as $module => $directories) {
       $expected_directory = array_shift($directories);
       $expected_uri = "$expected_directory/$module/$module.info.yml";
-      $this->assertEqual($files[$module]->getPathname(), $expected_uri, format_string('Module @actual was found at @expected.', array(
+      $this->assertEqual($files[$module]->getPathname(), $expected_uri, String::format('Module @actual was found at @expected.', array(
         '@actual' => $files[$module]->getPathname(),
         '@expected' => $expected_uri,
       )));
diff --git a/core/modules/system/src/Tests/Common/UrlTest.php b/core/modules/system/src/Tests/Common/UrlTest.php
index 92342d2..44bac6d 100644
--- a/core/modules/system/src/Tests/Common/UrlTest.php
+++ b/core/modules/system/src/Tests/Common/UrlTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Common;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\UrlHelper;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Url;
@@ -37,12 +38,12 @@ function testLinkXSS() {
     $path = "<SCRIPT>alert('XSS')</SCRIPT>";
     $link = _l($text, $path);
     $sanitized_path = check_url(_url($path));
-    $this->assertTrue(strpos($link, $sanitized_path) !== FALSE, format_string('XSS attack @path was filtered by _l().', array('@path' => $path)));
+    $this->assertTrue(strpos($link, $sanitized_path) !== FALSE, String::format('XSS attack @path was filtered by _l().', array('@path' => $path)));
 
     // Test _url().
     $link = _url($path);
     $sanitized_path = check_url(_url($path));
-    $this->assertTrue(strpos($link, $sanitized_path) !== FALSE, format_string('XSS attack @path was filtered by #theme', ['@path' => $path]));
+    $this->assertTrue(strpos($link, $sanitized_path) !== FALSE, String::format('XSS attack @path was filtered by #theme', ['@path' => $path]));
   }
 
   /**
@@ -67,10 +68,10 @@ function testLinkAttributes() {
     $hreflang_override_link['#options']['attributes']['hreflang'] = 'foo';
 
     $rendered = drupal_render($hreflang_link);
-    $this->assertTrue($this->hasAttribute('hreflang', $rendered, $langcode), format_string('hreflang attribute with value @langcode is present on a rendered link when langcode is provided in the render array.', array('@langcode' => $langcode)));
+    $this->assertTrue($this->hasAttribute('hreflang', $rendered, $langcode), String::format('hreflang attribute with value @langcode is present on a rendered link when langcode is provided in the render array.', array('@langcode' => $langcode)));
 
     $rendered = drupal_render($hreflang_override_link);
-    $this->assertTrue($this->hasAttribute('hreflang', $rendered, 'foo'), format_string('hreflang attribute with value @hreflang is present on a rendered link when @hreflang is provided in the render array.', array('@hreflang' => 'foo')));
+    $this->assertTrue($this->hasAttribute('hreflang', $rendered, 'foo'), String::format('hreflang attribute with value @hreflang is present on a rendered link when @hreflang is provided in the render array.', array('@hreflang' => 'foo')));
 
     // Test the active class in links produced by _l() and #type 'link'.
     $options_no_query = array();
@@ -111,7 +112,7 @@ function testLinkAttributes() {
     // Test _l().
     $class_l = $this->randomMachineName();
     $link_l = \Drupal::l($this->randomMachineName(), new Url('<current>', [], ['attributes' => ['class' => [$class_l]]]));
-    $this->assertTrue($this->hasAttribute('class', $link_l, $class_l), format_string('Custom class @class is present on link when requested by l()', array('@class' => $class_l)));
+    $this->assertTrue($this->hasAttribute('class', $link_l, $class_l), String::format('Custom class @class is present on link when requested by l()', array('@class' => $class_l)));
 
     // Test #type.
     $class_theme = $this->randomMachineName();
@@ -126,7 +127,7 @@ function testLinkAttributes() {
       ),
     );
     $link_theme = drupal_render($type_link);
-    $this->assertTrue($this->hasAttribute('class', $link_theme, $class_theme), format_string('Custom class @class is present on link when requested by #type', array('@class' => $class_theme)));
+    $this->assertTrue($this->hasAttribute('class', $link_theme, $class_theme), String::format('Custom class @class is present on link when requested by #type', array('@class' => $class_theme)));
   }
 
   /**
diff --git a/core/modules/system/src/Tests/Database/ConnectionUnitTest.php b/core/modules/system/src/Tests/Database/ConnectionUnitTest.php
index 0d7e506..db8223e 100644
--- a/core/modules/system/src/Tests/Database/ConnectionUnitTest.php
+++ b/core/modules/system/src/Tests/Database/ConnectionUnitTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Database;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Database\Database;
 use Drupal\simpletest\KernelTestBase;
 
@@ -80,7 +81,7 @@ protected function getConnectionID() {
    */
   protected function assertConnection($id) {
     $list = $this->monitor->query('SHOW PROCESSLIST')->fetchAllKeyed(0, 0);
-    return $this->assertTrue(isset($list[$id]), format_string('Connection ID @id found.', array('@id' => $id)));
+    return $this->assertTrue(isset($list[$id]), String::format('Connection ID @id found.', array('@id' => $id)));
   }
 
   /**
@@ -91,7 +92,7 @@ protected function assertConnection($id) {
    */
   protected function assertNoConnection($id) {
     $list = $this->monitor->query('SHOW PROCESSLIST')->fetchAllKeyed(0, 0);
-    return $this->assertFalse(isset($list[$id]), format_string('Connection ID @id not found.', array('@id' => $id)));
+    return $this->assertFalse(isset($list[$id]), String::format('Connection ID @id not found.', array('@id' => $id)));
   }
 
   /**
diff --git a/core/modules/system/src/Tests/Database/InsertLobTest.php b/core/modules/system/src/Tests/Database/InsertLobTest.php
index 2fcf182..f520a14 100644
--- a/core/modules/system/src/Tests/Database/InsertLobTest.php
+++ b/core/modules/system/src/Tests/Database/InsertLobTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\system\Tests\Database;
+use Drupal\Component\Utility\String;
 
 /**
  * Tests the Insert query builder with LOB fields.
@@ -24,7 +25,7 @@ function testInsertOneBlob() {
       ->fields(array('blob1' => $data))
       ->execute();
     $r = db_query('SELECT * FROM {test_one_blob} WHERE id = :id', array(':id' => $id))->fetchAssoc();
-    $this->assertTrue($r['blob1'] === $data, format_string('Can insert a blob: id @id, @data.', array('@id' => $id, '@data' => serialize($r))));
+    $this->assertTrue($r['blob1'] === $data, String::format('Can insert a blob: id @id, @data.', array('@id' => $id, '@data' => serialize($r))));
   }
 
   /**
diff --git a/core/modules/system/src/Tests/Database/SchemaTest.php b/core/modules/system/src/Tests/Database/SchemaTest.php
index 9009e72..d762a92 100644
--- a/core/modules/system/src/Tests/Database/SchemaTest.php
+++ b/core/modules/system/src/Tests/Database/SchemaTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Database;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\SchemaObjectDoesNotExistException;
 use Drupal\Core\Database\SchemaObjectExistsException;
@@ -248,8 +249,8 @@ function testUnsignedColumns() {
 
     // Finally, check each column and try to insert invalid values into them.
     foreach ($table_spec['fields'] as $column_name => $column_spec) {
-      $this->assertTrue(db_field_exists($table_name, $column_name), format_string('Unsigned @type column was created.', array('@type' => $column_spec['type'])));
-      $this->assertFalse($this->tryUnsignedInsert($table_name, $column_name), format_string('Unsigned @type column rejected a negative value.', array('@type' => $column_spec['type'])));
+      $this->assertTrue(db_field_exists($table_name, $column_name), String::format('Unsigned @type column was created.', array('@type' => $column_spec['type'])));
+      $this->assertFalse($this->tryUnsignedInsert($table_name, $column_name), String::format('Unsigned @type column rejected a negative value.', array('@type' => $column_spec['type'])));
     }
   }
 
@@ -371,7 +372,7 @@ protected function assertFieldAdditionRemoval($field_spec) {
       'primary key' => array('serial_column'),
     );
     db_create_table($table_name, $table_spec);
-    $this->pass(format_string('Table %table created.', array('%table' => $table_name)));
+    $this->pass(String::format('Table %table created.', array('%table' => $table_name)));
 
     // Check the characteristics of the field.
     $this->assertFieldCharacteristics($table_name, 'test_field', $field_spec);
@@ -388,7 +389,7 @@ protected function assertFieldAdditionRemoval($field_spec) {
       'primary key' => array('serial_column'),
     );
     db_create_table($table_name, $table_spec);
-    $this->pass(format_string('Table %table created.', array('%table' => $table_name)));
+    $this->pass(String::format('Table %table created.', array('%table' => $table_name)));
 
     // Insert some rows to the table to test the handling of initial values.
     for ($i = 0; $i < 3; $i++) {
@@ -398,7 +399,7 @@ protected function assertFieldAdditionRemoval($field_spec) {
     }
 
     db_add_field($table_name, 'test_field', $field_spec);
-    $this->pass(format_string('Column %column created.', array('%column' => 'test_field')));
+    $this->pass(String::format('Column %column created.', array('%column' => 'test_field')));
 
     // Check the characteristics of the field.
     $this->assertFieldCharacteristics($table_name, 'test_field', $field_spec);
diff --git a/core/modules/system/src/Tests/Database/SelectComplexTest.php b/core/modules/system/src/Tests/Database/SelectComplexTest.php
index f63d84d..625d77b 100644
--- a/core/modules/system/src/Tests/Database/SelectComplexTest.php
+++ b/core/modules/system/src/Tests/Database/SelectComplexTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Database;
 
+use Drupal\Component\Utility\String;
 use \Drupal\Core\Database\RowCountException;
 
 /**
@@ -102,7 +103,7 @@ function testGroupBy() {
     );
 
     foreach ($correct_results as $task => $count) {
-      $this->assertEqual($records[$task], $count, format_string("Correct number of '@task' records found.", array('@task' => $task)));
+      $this->assertEqual($records[$task], $count, String::format("Correct number of '@task' records found.", array('@task' => $task)));
     }
 
     $this->assertEqual($num_records, 6, 'Returned the correct number of total rows.');
@@ -136,7 +137,7 @@ function testGroupByAndHaving() {
     );
 
     foreach ($correct_results as $task => $count) {
-      $this->assertEqual($records[$task], $count, format_string("Correct number of '@task' records found.", array('@task' => $task)));
+      $this->assertEqual($records[$task], $count, String::format("Correct number of '@task' records found.", array('@task' => $task)));
     }
 
     $this->assertEqual($num_records, 1, 'Returned the correct number of total rows.');
diff --git a/core/modules/system/src/Tests/Database/SelectPagerDefaultTest.php b/core/modules/system/src/Tests/Database/SelectPagerDefaultTest.php
index 6c358f0..22652f2 100644
--- a/core/modules/system/src/Tests/Database/SelectPagerDefaultTest.php
+++ b/core/modules/system/src/Tests/Database/SelectPagerDefaultTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\system\Tests\Database;
+use Drupal\Component\Utility\String;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
@@ -45,7 +46,7 @@ function testEvenPagerQuery() {
         $correct_number = $count - ($limit * $page);
       }
 
-      $this->assertEqual(count($data->names), $correct_number, format_string('Correct number of records returned by pager: @number', array('@number' => $correct_number)));
+      $this->assertEqual(count($data->names), $correct_number, String::format('Correct number of records returned by pager: @number', array('@number' => $correct_number)));
     }
   }
 
@@ -79,7 +80,7 @@ function testOddPagerQuery() {
         $correct_number = $count - ($limit * $page);
       }
 
-      $this->assertEqual(count($data->names), $correct_number, format_string('Correct number of records returned by pager: @number', array('@number' => $correct_number)));
+      $this->assertEqual(count($data->names), $correct_number, String::format('Correct number of records returned by pager: @number', array('@number' => $correct_number)));
     }
   }
 
diff --git a/core/modules/system/src/Tests/Database/SelectTableSortDefaultTest.php b/core/modules/system/src/Tests/Database/SelectTableSortDefaultTest.php
index 2102667..4239769 100644
--- a/core/modules/system/src/Tests/Database/SelectTableSortDefaultTest.php
+++ b/core/modules/system/src/Tests/Database/SelectTableSortDefaultTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\system\Tests\Database;
+use Drupal\Component\Utility\String;
 
 /**
  * Tests the tablesort query extender.
@@ -65,8 +66,8 @@ function testTableSortQueryFirst() {
       $first = array_shift($data->tasks);
       $last = array_pop($data->tasks);
 
-      $this->assertEqual($first->task, $sort['first'], format_string('Items appear in the correct order sorting by @field @sort.', array('@field' => $sort['field'], '@sort' => $sort['sort'])));
-      $this->assertEqual($last->task, $sort['last'], format_string('Items appear in the correct order sorting by @field @sort.', array('@field' => $sort['field'], '@sort' => $sort['sort'])));
+      $this->assertEqual($first->task, $sort['first'], String::format('Items appear in the correct order sorting by @field @sort.', array('@field' => $sort['field'], '@sort' => $sort['sort'])));
+      $this->assertEqual($last->task, $sort['last'], String::format('Items appear in the correct order sorting by @field @sort.', array('@field' => $sort['field'], '@sort' => $sort['sort'])));
     }
   }
 
diff --git a/core/modules/system/src/Tests/Database/TransactionTest.php b/core/modules/system/src/Tests/Database/TransactionTest.php
index 00ec458..11d23cc 100644
--- a/core/modules/system/src/Tests/Database/TransactionTest.php
+++ b/core/modules/system/src/Tests/Database/TransactionTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Database;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\TransactionOutOfOrderException;
 use Drupal\Core\Database\TransactionNoActiveException;
@@ -359,7 +360,7 @@ protected function cleanUp() {
    */
   function assertRowPresent($name, $message = NULL) {
     if (!isset($message)) {
-      $message = format_string('Row %name is present.', array('%name' => $name));
+      $message = String::format('Row %name is present.', array('%name' => $name));
     }
     $present = (boolean) db_query('SELECT 1 FROM {test} WHERE name = :name', array(':name' => $name))->fetchField();
     return $this->assertTrue($present, $message);
@@ -375,7 +376,7 @@ function assertRowPresent($name, $message = NULL) {
    */
   function assertRowAbsent($name, $message = NULL) {
     if (!isset($message)) {
-      $message = format_string('Row %name is absent.', array('%name' => $name));
+      $message = String::format('Row %name is absent.', array('%name' => $name));
     }
     $present = (boolean) db_query('SELECT 1 FROM {test} WHERE name = :name', array(':name' => $name))->fetchField();
     return $this->assertFalse($present, $message);
diff --git a/core/modules/system/src/Tests/Database/UpdateLobTest.php b/core/modules/system/src/Tests/Database/UpdateLobTest.php
index 7b26fdf..c8caebc 100644
--- a/core/modules/system/src/Tests/Database/UpdateLobTest.php
+++ b/core/modules/system/src/Tests/Database/UpdateLobTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\system\Tests\Database;
+use Drupal\Component\Utility\String;
 
 /**
  * Tests the Update query builder with LOB fields.
@@ -31,7 +32,7 @@ function testUpdateOneBlob() {
       ->execute();
 
     $r = db_query('SELECT * FROM {test_one_blob} WHERE id = :id', array(':id' => $id))->fetchAssoc();
-    $this->assertTrue($r['blob1'] === $data, format_string('Can update a blob: id @id, @data.', array('@id' => $id, '@data' => serialize($r))));
+    $this->assertTrue($r['blob1'] === $data, String::format('Can update a blob: id @id, @data.', array('@id' => $id, '@data' => serialize($r))));
   }
 
   /**
diff --git a/core/modules/system/src/Tests/Entity/EntityAccessControlHandlerTest.php b/core/modules/system/src/Tests/Entity/EntityAccessControlHandlerTest.php
index 76e87f4..70aead3 100644
--- a/core/modules/system/src/Tests/Entity/EntityAccessControlHandlerTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityAccessControlHandlerTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Access\AccessibleInterface;
 use Drupal\Core\Entity\EntityAccessControlHandler;
@@ -29,7 +30,7 @@ protected function setUp() {
    */
   function assertEntityAccess($ops, AccessibleInterface $object, AccountInterface $account = NULL) {
     foreach ($ops as $op => $result) {
-      $message = format_string("Entity access returns @result with operation '@op'.", array(
+      $message = String::format("Entity access returns @result with operation '@op'.", array(
         '@result' => !isset($result) ? 'null' : ($result ? 'true' : 'false'),
         '@op' => $op,
       ));
diff --git a/core/modules/system/src/Tests/Entity/EntityApiTest.php b/core/modules/system/src/Tests/Entity/EntityApiTest.php
index f30e94d..74378b9 100644
--- a/core/modules/system/src/Tests/Entity/EntityApiTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityApiTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityStorageException;
 use Drupal\user\UserInterface;
 
@@ -53,32 +54,32 @@ protected function assertCRUD($entity_type, UserInterface $user1) {
     $entity->save();
 
     $entities = array_values(entity_load_multiple_by_properties($entity_type, array('name' => 'test')));
-    $this->assertEqual($entities[0]->name->value, 'test', format_string('%entity_type: Created and loaded entity', array('%entity_type' => $entity_type)));
-    $this->assertEqual($entities[1]->name->value, 'test', format_string('%entity_type: Created and loaded entity', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entities[0]->name->value, 'test', String::format('%entity_type: Created and loaded entity', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entities[1]->name->value, 'test', String::format('%entity_type: Created and loaded entity', array('%entity_type' => $entity_type)));
 
     // Test loading a single entity.
     $loaded_entity = entity_load($entity_type, $entity->id());
-    $this->assertEqual($loaded_entity->id(), $entity->id(), format_string('%entity_type: Loaded a single entity by id.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($loaded_entity->id(), $entity->id(), String::format('%entity_type: Loaded a single entity by id.', array('%entity_type' => $entity_type)));
 
     // Test deleting an entity.
     $entities = array_values(entity_load_multiple_by_properties($entity_type, array('name' => 'test2')));
     $entities[0]->delete();
     $entities = array_values(entity_load_multiple_by_properties($entity_type, array('name' => 'test2')));
-    $this->assertEqual($entities, array(), format_string('%entity_type: Entity deleted.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entities, array(), String::format('%entity_type: Entity deleted.', array('%entity_type' => $entity_type)));
 
     // Test updating an entity.
     $entities = array_values(entity_load_multiple_by_properties($entity_type, array('name' => 'test')));
     $entities[0]->name->value = 'test3';
     $entities[0]->save();
     $entity = entity_load($entity_type, $entities[0]->id());
-    $this->assertEqual($entity->name->value, 'test3', format_string('%entity_type: Entity updated.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->name->value, 'test3', String::format('%entity_type: Entity updated.', array('%entity_type' => $entity_type)));
 
     // Try deleting multiple test entities by deleting all.
     $ids = array_keys(entity_load_multiple($entity_type));
     entity_delete_multiple($entity_type, $ids);
 
     $all = entity_load_multiple($entity_type);
-    $this->assertTrue(empty($all), format_string('%entity_type: Deleted all entities.', array('%entity_type' => $entity_type)));
+    $this->assertTrue(empty($all), String::format('%entity_type: Deleted all entities.', array('%entity_type' => $entity_type)));
 
     // Verify that all data got deleted.
     $definition = \Drupal::entityManager()->getDefinition($entity_type);
diff --git a/core/modules/system/src/Tests/Entity/EntityFieldTest.php b/core/modules/system/src/Tests/Entity/EntityFieldTest.php
index 369da19..795c383 100644
--- a/core/modules/system/src/Tests/Entity/EntityFieldTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityFieldTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Field\BaseFieldDefinition;
 use Drupal\Core\Field\FieldDefinitionInterface;
@@ -105,71 +106,71 @@ protected function doTestReadWrite($entity_type) {
     $langcode = 'en';
 
     // Access the name field.
-    $this->assertTrue($entity->name instanceof FieldItemListInterface, format_string('%entity_type: Field implements interface', array('%entity_type' => $entity_type)));
-    $this->assertTrue($entity->name[0] instanceof FieldItemInterface, format_string('%entity_type: Field item implements interface', array('%entity_type' => $entity_type)));
+    $this->assertTrue($entity->name instanceof FieldItemListInterface, String::format('%entity_type: Field implements interface', array('%entity_type' => $entity_type)));
+    $this->assertTrue($entity->name[0] instanceof FieldItemInterface, String::format('%entity_type: Field item implements interface', array('%entity_type' => $entity_type)));
 
-    $this->assertEqual($this->entity_name, $entity->name->value, format_string('%entity_type: Name value can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($this->entity_name, $entity->name[0]->value, format_string('%entity_type: Name value can be read through list access.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($entity->name->getValue(), array(0 => array('value' => $this->entity_name)), format_string('%entity_type: Plain field value returned.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($this->entity_name, $entity->name->value, String::format('%entity_type: Name value can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($this->entity_name, $entity->name[0]->value, String::format('%entity_type: Name value can be read through list access.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->name->getValue(), array(0 => array('value' => $this->entity_name)), String::format('%entity_type: Plain field value returned.', array('%entity_type' => $entity_type)));
 
     // Change the name.
     $new_name = $this->randomMachineName();
     $entity->name->value = $new_name;
-    $this->assertEqual($new_name, $entity->name->value, format_string('%entity_type: Name can be updated and read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($entity->name->getValue(), array(0 => array('value' => $new_name)), format_string('%entity_type: Plain field value reflects the update.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($new_name, $entity->name->value, String::format('%entity_type: Name can be updated and read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->name->getValue(), array(0 => array('value' => $new_name)), String::format('%entity_type: Plain field value reflects the update.', array('%entity_type' => $entity_type)));
 
     $new_name = $this->randomMachineName();
     $entity->name[0]->value = $new_name;
-    $this->assertEqual($new_name, $entity->name->value, format_string('%entity_type: Name can be updated and read through list access.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($new_name, $entity->name->value, String::format('%entity_type: Name can be updated and read through list access.', array('%entity_type' => $entity_type)));
 
     // Access the user field.
-    $this->assertTrue($entity->user_id instanceof FieldItemListInterface, format_string('%entity_type: Field implements interface', array('%entity_type' => $entity_type)));
-    $this->assertTrue($entity->user_id[0] instanceof FieldItemInterface, format_string('%entity_type: Field item implements interface', array('%entity_type' => $entity_type)));
+    $this->assertTrue($entity->user_id instanceof FieldItemListInterface, String::format('%entity_type: Field implements interface', array('%entity_type' => $entity_type)));
+    $this->assertTrue($entity->user_id[0] instanceof FieldItemInterface, String::format('%entity_type: Field item implements interface', array('%entity_type' => $entity_type)));
 
-    $this->assertEqual($this->entity_user->id(), $entity->user_id->target_id, format_string('%entity_type: User id can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($this->entity_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($this->entity_user->id(), $entity->user_id->target_id, String::format('%entity_type: User id can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($this->entity_user->getUsername(), $entity->user_id->entity->name->value, String::format('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
 
     // Change the assigned user by entity.
     $new_user = $this->createUser();
     $entity->user_id->entity = $new_user;
-    $this->assertEqual($new_user->id(), $entity->user_id->target_id, format_string('%entity_type: Updated user id can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($new_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated username value can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($new_user->id(), $entity->user_id->target_id, String::format('%entity_type: Updated user id can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($new_user->getUsername(), $entity->user_id->entity->name->value, String::format('%entity_type: Updated username value can be read.', array('%entity_type' => $entity_type)));
 
     // Change the assigned user by id.
     $new_user = $this->createUser();
     $entity->user_id->target_id = $new_user->id();
-    $this->assertEqual($new_user->id(), $entity->user_id->target_id, format_string('%entity_type: Updated user id can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($new_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated username value can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($new_user->id(), $entity->user_id->target_id, String::format('%entity_type: Updated user id can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($new_user->getUsername(), $entity->user_id->entity->name->value, String::format('%entity_type: Updated username value can be read.', array('%entity_type' => $entity_type)));
 
     // Try unsetting a field.
     $entity->name->value = NULL;
     $entity->user_id->target_id = NULL;
-    $this->assertNull($entity->name->value, format_string('%entity_type: Name field is not set.', array('%entity_type' => $entity_type)));
-    $this->assertNull($entity->user_id->target_id, format_string('%entity_type: User ID field is not set.', array('%entity_type' => $entity_type)));
-    $this->assertNull($entity->user_id->entity, format_string('%entity_type: User entity field is not set.', array('%entity_type' => $entity_type)));
+    $this->assertNull($entity->name->value, String::format('%entity_type: Name field is not set.', array('%entity_type' => $entity_type)));
+    $this->assertNull($entity->user_id->target_id, String::format('%entity_type: User ID field is not set.', array('%entity_type' => $entity_type)));
+    $this->assertNull($entity->user_id->entity, String::format('%entity_type: User entity field is not set.', array('%entity_type' => $entity_type)));
 
     // Test using isset(), empty() and unset().
     $entity->name->value = 'test unset';
     unset($entity->name->value);
-    $this->assertFalse(isset($entity->name->value), format_string('%entity_type: Name is not set.', array('%entity_type' => $entity_type)));
-    $this->assertFalse(isset($entity->name[0]->value), format_string('%entity_type: Name is not set.', array('%entity_type' => $entity_type)));
-    $this->assertTrue(empty($entity->name->value), format_string('%entity_type: Name is empty.', array('%entity_type' => $entity_type)));
-    $this->assertTrue(empty($entity->name[0]->value), format_string('%entity_type: Name is empty.', array('%entity_type' => $entity_type)));
+    $this->assertFalse(isset($entity->name->value), String::format('%entity_type: Name is not set.', array('%entity_type' => $entity_type)));
+    $this->assertFalse(isset($entity->name[0]->value), String::format('%entity_type: Name is not set.', array('%entity_type' => $entity_type)));
+    $this->assertTrue(empty($entity->name->value), String::format('%entity_type: Name is empty.', array('%entity_type' => $entity_type)));
+    $this->assertTrue(empty($entity->name[0]->value), String::format('%entity_type: Name is empty.', array('%entity_type' => $entity_type)));
 
     $entity->name->value = 'a value';
-    $this->assertTrue(isset($entity->name->value), format_string('%entity_type: Name is set.', array('%entity_type' => $entity_type)));
-    $this->assertTrue(isset($entity->name[0]->value), format_string('%entity_type: Name is set.', array('%entity_type' => $entity_type)));
-    $this->assertFalse(empty($entity->name->value), format_string('%entity_type: Name is not empty.', array('%entity_type' => $entity_type)));
-    $this->assertFalse(empty($entity->name[0]->value), format_string('%entity_type: Name is not empty.', array('%entity_type' => $entity_type)));
-    $this->assertTrue(isset($entity->name[0]), format_string('%entity_type: Name string item is set.', array('%entity_type' => $entity_type)));
-    $this->assertFalse(isset($entity->name[1]), format_string('%entity_type: Second name string item is not set as it does not exist', array('%entity_type' => $entity_type)));
-    $this->assertTrue(isset($entity->name), format_string('%entity_type: Name field is set.', array('%entity_type' => $entity_type)));
-    $this->assertFalse(isset($entity->nameInvalid), format_string('%entity_type: Not existing field is not set.', array('%entity_type' => $entity_type)));
+    $this->assertTrue(isset($entity->name->value), String::format('%entity_type: Name is set.', array('%entity_type' => $entity_type)));
+    $this->assertTrue(isset($entity->name[0]->value), String::format('%entity_type: Name is set.', array('%entity_type' => $entity_type)));
+    $this->assertFalse(empty($entity->name->value), String::format('%entity_type: Name is not empty.', array('%entity_type' => $entity_type)));
+    $this->assertFalse(empty($entity->name[0]->value), String::format('%entity_type: Name is not empty.', array('%entity_type' => $entity_type)));
+    $this->assertTrue(isset($entity->name[0]), String::format('%entity_type: Name string item is set.', array('%entity_type' => $entity_type)));
+    $this->assertFalse(isset($entity->name[1]), String::format('%entity_type: Second name string item is not set as it does not exist', array('%entity_type' => $entity_type)));
+    $this->assertTrue(isset($entity->name), String::format('%entity_type: Name field is set.', array('%entity_type' => $entity_type)));
+    $this->assertFalse(isset($entity->nameInvalid), String::format('%entity_type: Not existing field is not set.', array('%entity_type' => $entity_type)));
 
     unset($entity->name[0]);
-    $this->assertFalse(isset($entity->name[0]), format_string('%entity_type: Name field item is not set.', array('%entity_type' => $entity_type)));
-    $this->assertFalse(isset($entity->name[0]->value), format_string('%entity_type: Name is not set.', array('%entity_type' => $entity_type)));
-    $this->assertFalse(isset($entity->name->value), format_string('%entity_type: Name is not set.', array('%entity_type' => $entity_type)));
+    $this->assertFalse(isset($entity->name[0]), String::format('%entity_type: Name field item is not set.', array('%entity_type' => $entity_type)));
+    $this->assertFalse(isset($entity->name[0]->value), String::format('%entity_type: Name is not set.', array('%entity_type' => $entity_type)));
+    $this->assertFalse(isset($entity->name->value), String::format('%entity_type: Name is not set.', array('%entity_type' => $entity_type)));
 
     $entity->name = array();
     $this->assertTrue(isset($entity->name), 'Name field is set.');
@@ -184,33 +185,33 @@ protected function doTestReadWrite($entity_type) {
     $this->assertFalse(isset($entity->name->value), 'Name value is not set.');
 
     $entity->name->value = 'a value';
-    $this->assertTrue(isset($entity->name->value), format_string('%entity_type: Name is set.', array('%entity_type' => $entity_type)));
+    $this->assertTrue(isset($entity->name->value), String::format('%entity_type: Name is set.', array('%entity_type' => $entity_type)));
     unset($entity->name);
-    $this->assertFalse(isset($entity->name), format_string('%entity_type: Name field is not set.', array('%entity_type' => $entity_type)));
-    $this->assertFalse(isset($entity->name[0]), format_string('%entity_type: Name field item is not set.', array('%entity_type' => $entity_type)));
-    $this->assertFalse(isset($entity->name[0]->value), format_string('%entity_type: Name is not set.', array('%entity_type' => $entity_type)));
-    $this->assertFalse(isset($entity->name->value), format_string('%entity_type: Name is not set.', array('%entity_type' => $entity_type)));
+    $this->assertFalse(isset($entity->name), String::format('%entity_type: Name field is not set.', array('%entity_type' => $entity_type)));
+    $this->assertFalse(isset($entity->name[0]), String::format('%entity_type: Name field item is not set.', array('%entity_type' => $entity_type)));
+    $this->assertFalse(isset($entity->name[0]->value), String::format('%entity_type: Name is not set.', array('%entity_type' => $entity_type)));
+    $this->assertFalse(isset($entity->name->value), String::format('%entity_type: Name is not set.', array('%entity_type' => $entity_type)));
 
     // Access the language field.
-    $this->assertEqual($langcode, $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual(\Drupal::languageManager()->getLanguage($langcode), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($langcode, $entity->langcode->value, String::format('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(\Drupal::languageManager()->getLanguage($langcode), $entity->langcode->language, String::format('%entity_type: Language object can be read.', array('%entity_type' => $entity_type)));
 
     // Change the language by code.
     $entity->langcode->value = \Drupal::languageManager()->getDefaultLanguage()->getId();
-    $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage()->getId(), $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage(), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage()->getId(), $entity->langcode->value, String::format('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage(), $entity->langcode->language, String::format('%entity_type: Language object can be read.', array('%entity_type' => $entity_type)));
 
     // Revert language by code then try setting it by language object.
     $entity->langcode->value = $langcode;
     $entity->langcode->language = \Drupal::languageManager()->getDefaultLanguage();
-    $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage()->getId(), $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage(), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage()->getId(), $entity->langcode->value, String::format('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage(), $entity->langcode->language, String::format('%entity_type: Language object can be read.', array('%entity_type' => $entity_type)));
 
     // Access the text field and test updating.
-    $this->assertEqual($entity->field_test_text->value, $this->entity_field_text, format_string('%entity_type: Text field can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->field_test_text->value, $this->entity_field_text, String::format('%entity_type: Text field can be read.', array('%entity_type' => $entity_type)));
     $new_text = $this->randomMachineName();
     $entity->field_test_text->value = $new_text;
-    $this->assertEqual($entity->field_test_text->value, $new_text, format_string('%entity_type: Updated text field can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->field_test_text->value, $new_text, String::format('%entity_type: Updated text field can be read.', array('%entity_type' => $entity_type)));
 
     // Test creating the entity by passing in plain values.
     $this->entity_name = $this->randomMachineName();
@@ -225,10 +226,10 @@ protected function doTestReadWrite($entity_type) {
       'user_id' => $user_item,
       'field_test_text' => $text_item,
     ));
-    $this->assertEqual($this->entity_name, $entity->name->value, format_string('%entity_type: Name value can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($this->entity_user->id(), $entity->user_id->target_id, format_string('%entity_type: User id can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($this->entity_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($this->entity_field_text, $entity->field_test_text->value, format_string('%entity_type: Text field can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($this->entity_name, $entity->name->value, String::format('%entity_type: Name value can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($this->entity_user->id(), $entity->user_id->target_id, String::format('%entity_type: User id can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($this->entity_user->getUsername(), $entity->user_id->entity->name->value, String::format('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($this->entity_field_text, $entity->field_test_text->value, String::format('%entity_type: Text field can be read.', array('%entity_type' => $entity_type)));
 
     // Test copying field values.
     $entity2 = $this->createTestEntity($entity_type);
@@ -236,53 +237,53 @@ protected function doTestReadWrite($entity_type) {
     $entity2->user_id = $entity->user_id;
     $entity2->field_test_text = $entity->field_test_text;
 
-    $this->assertTrue($entity->name !== $entity2->name, format_string('%entity_type: Copying properties results in a different field object.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($entity->name->value, $entity2->name->value, format_string('%entity_type: Name field copied.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($entity->user_id->target_id, $entity2->user_id->target_id, format_string('%entity_type: User id field copied.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($entity->field_test_text->value, $entity2->field_test_text->value, format_string('%entity_type: Text field copied.', array('%entity_type' => $entity_type)));
+    $this->assertTrue($entity->name !== $entity2->name, String::format('%entity_type: Copying properties results in a different field object.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->name->value, $entity2->name->value, String::format('%entity_type: Name field copied.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->user_id->target_id, $entity2->user_id->target_id, String::format('%entity_type: User id field copied.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->field_test_text->value, $entity2->field_test_text->value, String::format('%entity_type: Text field copied.', array('%entity_type' => $entity_type)));
 
     // Tests adding a value to a field item list.
     $entity->name[] = 'Another name';
-    $this->assertEqual($entity->name[1]->value, 'Another name', format_string('%entity_type: List item added via [].', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->name[1]->value, 'Another name', String::format('%entity_type: List item added via [].', array('%entity_type' => $entity_type)));
     $entity->name[2]->value = 'Third name';
-    $this->assertEqual($entity->name[2]->value, 'Third name', format_string('%entity_type: List item added by a accessing not yet created item.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->name[2]->value, 'Third name', String::format('%entity_type: List item added by a accessing not yet created item.', array('%entity_type' => $entity_type)));
 
     // Test removing and empty-ing list items.
-    $this->assertEqual(count($entity->name), 3, format_string('%entity_type: List has 3 items.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(count($entity->name), 3, String::format('%entity_type: List has 3 items.', array('%entity_type' => $entity_type)));
     unset($entity->name[1]);
-    $this->assertEqual(count($entity->name), 2, format_string('%entity_type: Second list item has been removed.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(count($entity->name), 2, String::format('%entity_type: Second list item has been removed.', array('%entity_type' => $entity_type)));
     $entity->name[2] = NULL;
-    $this->assertEqual(count($entity->name), 2, format_string('%entity_type: Assigning NULL does not reduce array count.', array('%entity_type' => $entity_type)));
-    $this->assertTrue($entity->name[2]->isEmpty(), format_string('%entity_type: Assigning NULL empties the item.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(count($entity->name), 2, String::format('%entity_type: Assigning NULL does not reduce array count.', array('%entity_type' => $entity_type)));
+    $this->assertTrue($entity->name[2]->isEmpty(), String::format('%entity_type: Assigning NULL empties the item.', array('%entity_type' => $entity_type)));
 
     // Test using isEmpty().
     unset($entity->name[2]);
-    $this->assertFalse($entity->name[0]->isEmpty(), format_string('%entity_type: Name item is not empty.', array('%entity_type' => $entity_type)));
+    $this->assertFalse($entity->name[0]->isEmpty(), String::format('%entity_type: Name item is not empty.', array('%entity_type' => $entity_type)));
     $entity->name->value = NULL;
-    $this->assertTrue($entity->name[0]->isEmpty(), format_string('%entity_type: Name item is empty.', array('%entity_type' => $entity_type)));
-    $this->assertTrue($entity->name->isEmpty(), format_string('%entity_type: Name field is empty.', array('%entity_type' => $entity_type)));
-    $this->assertEqual(count($entity->name), 1, format_string('%entity_type: Empty item is considered when counting.', array('%entity_type' => $entity_type)));
-    $this->assertEqual(count(iterator_to_array($entity->name->getIterator())), count($entity->name), format_string('%entity_type: Count matches iterator count.', array('%entity_type' => $entity_type)));
-    $this->assertTrue($entity->name->getValue() === array(0 => array('value' => NULL)), format_string('%entity_type: Name field value contains a NULL value.', array('%entity_type' => $entity_type)));
+    $this->assertTrue($entity->name[0]->isEmpty(), String::format('%entity_type: Name item is empty.', array('%entity_type' => $entity_type)));
+    $this->assertTrue($entity->name->isEmpty(), String::format('%entity_type: Name field is empty.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(count($entity->name), 1, String::format('%entity_type: Empty item is considered when counting.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(count(iterator_to_array($entity->name->getIterator())), count($entity->name), String::format('%entity_type: Count matches iterator count.', array('%entity_type' => $entity_type)));
+    $this->assertTrue($entity->name->getValue() === array(0 => array('value' => NULL)), String::format('%entity_type: Name field value contains a NULL value.', array('%entity_type' => $entity_type)));
 
     // Test removing all list items by assigning an empty array.
     $entity->name = array();
-    $this->assertIdentical(count($entity->name), 0, format_string('%entity_type: Name field contains no items.', array('%entity_type' => $entity_type)));
-    $this->assertIdentical($entity->name->getValue(), array(), format_string('%entity_type: Name field value is an empty array.', array('%entity_type' => $entity_type)));
+    $this->assertIdentical(count($entity->name), 0, String::format('%entity_type: Name field contains no items.', array('%entity_type' => $entity_type)));
+    $this->assertIdentical($entity->name->getValue(), array(), String::format('%entity_type: Name field value is an empty array.', array('%entity_type' => $entity_type)));
 
     $entity->name->value = 'foo';
-    $this->assertEqual($entity->name->value, 'foo', format_string('%entity_type: Name field set.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->name->value, 'foo', String::format('%entity_type: Name field set.', array('%entity_type' => $entity_type)));
     // Test removing all list items by setting it to NULL.
     $entity->name = NULL;
-    $this->assertIdentical(count($entity->name), 0, format_string('%entity_type: Name field contains no items.', array('%entity_type' => $entity_type)));
-    $this->assertNull($entity->name->getValue(), format_string('%entity_type: Name field value is an empty array.', array('%entity_type' => $entity_type)));
+    $this->assertIdentical(count($entity->name), 0, String::format('%entity_type: Name field contains no items.', array('%entity_type' => $entity_type)));
+    $this->assertNull($entity->name->getValue(), String::format('%entity_type: Name field value is an empty array.', array('%entity_type' => $entity_type)));
 
     // Test get and set field values.
     $entity->name = 'foo';
-    $this->assertEqual($entity->name[0]->toArray(), array('value' => 'foo'), format_string('%entity_type: Field value has been retrieved via toArray()', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->name[0]->toArray(), array('value' => 'foo'), String::format('%entity_type: Field value has been retrieved via toArray()', array('%entity_type' => $entity_type)));
 
     $values = $entity->toArray();
-    $this->assertEqual($values['name'], array(0 => array('value' => 'foo')), format_string('%entity_type: Field value has been retrieved via toArray() from an entity.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($values['name'], array(0 => array('value' => 'foo')), String::format('%entity_type: Field value has been retrieved via toArray() from an entity.', array('%entity_type' => $entity_type)));
 
     // Make sure the user id can be set to zero.
     $user_item[0]['target_id'] = 0;
@@ -291,8 +292,8 @@ protected function doTestReadWrite($entity_type) {
       'user_id' => $user_item,
       'field_test_text' => $text_item,
     ));
-    $this->assertNotNull($entity->user_id->target_id, format_string('%entity_type: User id is not NULL', array('%entity_type' => $entity_type)));
-    $this->assertIdentical($entity->user_id->target_id, 0, format_string('%entity_type: User id has been set to 0', array('%entity_type' => $entity_type)));
+    $this->assertNotNull($entity->user_id->target_id, String::format('%entity_type: User id is not NULL', array('%entity_type' => $entity_type)));
+    $this->assertIdentical($entity->user_id->target_id, 0, String::format('%entity_type: User id has been set to 0', array('%entity_type' => $entity_type)));
 
     // Test setting the ID with the value only.
     $entity = entity_create($entity_type, array(
@@ -300,8 +301,8 @@ protected function doTestReadWrite($entity_type) {
       'user_id' => 0,
       'field_test_text' => $text_item,
     ));
-    $this->assertNotNull($entity->user_id->target_id, format_string('%entity_type: User id is not NULL', array('%entity_type' => $entity_type)));
-    $this->assertIdentical($entity->user_id->target_id, 0, format_string('%entity_type: User id has been set to 0', array('%entity_type' => $entity_type)));
+    $this->assertNotNull($entity->user_id->target_id, String::format('%entity_type: User id is not NULL', array('%entity_type' => $entity_type)));
+    $this->assertIdentical($entity->user_id->target_id, 0, String::format('%entity_type: User id has been set to 0', array('%entity_type' => $entity_type)));
   }
 
   /**
@@ -323,19 +324,19 @@ public function testSave() {
   protected function doTestSave($entity_type) {
     $entity = $this->createTestEntity($entity_type);
     $entity->save();
-    $this->assertTrue((bool) $entity->id(), format_string('%entity_type: Entity has received an id.', array('%entity_type' => $entity_type)));
+    $this->assertTrue((bool) $entity->id(), String::format('%entity_type: Entity has received an id.', array('%entity_type' => $entity_type)));
 
     $entity = entity_load($entity_type, $entity->id());
-    $this->assertTrue((bool) $entity->id(), format_string('%entity_type: Entity loaded.', array('%entity_type' => $entity_type)));
+    $this->assertTrue((bool) $entity->id(), String::format('%entity_type: Entity loaded.', array('%entity_type' => $entity_type)));
 
     // Access the name field.
-    $this->assertEqual(1, $entity->id->value, format_string('%entity_type: ID value can be read.', array('%entity_type' => $entity_type)));
-    $this->assertTrue(is_string($entity->uuid->value), format_string('%entity_type: UUID value can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual('en', $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual(\Drupal::languageManager()->getLanguage('en'), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($this->entity_user->id(), $entity->user_id->target_id, format_string('%entity_type: User id can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($this->entity_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($this->entity_field_text, $entity->field_test_text->value, format_string('%entity_type: Text field can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(1, $entity->id->value, String::format('%entity_type: ID value can be read.', array('%entity_type' => $entity_type)));
+    $this->assertTrue(is_string($entity->uuid->value), String::format('%entity_type: UUID value can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual('en', $entity->langcode->value, String::format('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(\Drupal::languageManager()->getLanguage('en'), $entity->langcode->language, String::format('%entity_type: Language object can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($this->entity_user->id(), $entity->user_id->target_id, String::format('%entity_type: User id can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($this->entity_user->getUsername(), $entity->user_id->entity->name->value, String::format('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($this->entity_field_text, $entity->field_test_text->value, String::format('%entity_type: Text field can be read.', array('%entity_type' => $entity_type)));
   }
 
   /**
@@ -474,8 +475,8 @@ protected function doTestIterator($entity_type) {
     }
 
     $fields = $entity->getFields();
-    $this->assertEqual(array_keys($fields), array_keys($entity->getTypedData()->getDataDefinition()->getPropertyDefinitions()), format_string('%entity_type: All fields returned.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($fields, iterator_to_array($entity->getIterator()), format_string('%entity_type: Entity iterator iterates over all fields.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(array_keys($fields), array_keys($entity->getTypedData()->getDataDefinition()->getPropertyDefinitions()), String::format('%entity_type: All fields returned.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($fields, iterator_to_array($entity->getIterator()), String::format('%entity_type: Entity iterator iterates over all fields.', array('%entity_type' => $entity_type)));
   }
 
   /**
@@ -515,7 +516,7 @@ protected function doTestDataStructureInterfaces($entity_type) {
       // Field format.
       NULL,
     );
-    $this->assertEqual($strings, $target_strings, format_string('%entity_type: All contained strings found.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($strings, $target_strings, String::format('%entity_type: All contained strings found.', array('%entity_type' => $entity_type)));
   }
 
   /**
@@ -685,12 +686,12 @@ protected function doTestComputedProperties($entity_type) {
     $entity->field_test_text->format = filter_default_format();
 
     $target = "<p>The &lt;strong&gt;text&lt;/strong&gt; text to filter.</p>\n";
-    $this->assertEqual($entity->field_test_text->processed, $target, format_string('%entity_type: Text is processed with the default filter.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->field_test_text->processed, $target, String::format('%entity_type: Text is processed with the default filter.', array('%entity_type' => $entity_type)));
 
     // Save and load entity and make sure it still works.
     $entity->save();
     $entity = entity_load($entity_type, $entity->id());
-    $this->assertEqual($entity->field_test_text->processed, $target, format_string('%entity_type: Text is processed with the default filter.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->field_test_text->processed, $target, String::format('%entity_type: Text is processed with the default filter.', array('%entity_type' => $entity_type)));
   }
 
 }
diff --git a/core/modules/system/src/Tests/Entity/EntityFormTest.php b/core/modules/system/src/Tests/Entity/EntityFormTest.php
index e7b21c6..14e3551 100644
--- a/core/modules/system/src/Tests/Entity/EntityFormTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityFormTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -67,21 +68,21 @@ protected function assertFormCRUD($entity_type) {
 
     $this->drupalPostForm($entity_type . '/add', $edit, t('Save'));
     $entity = $this->loadEntityByName($entity_type, $name1);
-    $this->assertTrue($entity, format_string('%entity_type: Entity found in the database.', array('%entity_type' => $entity_type)));
+    $this->assertTrue($entity, String::format('%entity_type: Entity found in the database.', array('%entity_type' => $entity_type)));
 
     $edit['name[0][value]'] = $name2;
     $this->drupalPostForm($entity_type . '/manage/' . $entity->id(), $edit, t('Save'));
     $entity = $this->loadEntityByName($entity_type, $name1);
-    $this->assertFalse($entity, format_string('%entity_type: The entity has been modified.', array('%entity_type' => $entity_type)));
+    $this->assertFalse($entity, String::format('%entity_type: The entity has been modified.', array('%entity_type' => $entity_type)));
     $entity = $this->loadEntityByName($entity_type, $name2);
-    $this->assertTrue($entity, format_string('%entity_type: Modified entity found in the database.', array('%entity_type' => $entity_type)));
-    $this->assertNotEqual($entity->name->value, $name1, format_string('%entity_type: The entity name has been modified.', array('%entity_type' => $entity_type)));
+    $this->assertTrue($entity, String::format('%entity_type: Modified entity found in the database.', array('%entity_type' => $entity_type)));
+    $this->assertNotEqual($entity->name->value, $name1, String::format('%entity_type: The entity name has been modified.', array('%entity_type' => $entity_type)));
 
     $this->drupalGet($entity_type . '/manage/' . $entity->id());
     $this->clickLink(t('Delete'));
     $this->drupalPostForm(NULL, array(), t('Confirm'));
     $entity = $this->loadEntityByName($entity_type, $name2);
-    $this->assertFalse($entity, format_string('%entity_type: Entity not found in the database.', array('%entity_type' => $entity_type)));
+    $this->assertFalse($entity, String::format('%entity_type: Entity not found in the database.', array('%entity_type' => $entity_type)));
   }
 
   /**
diff --git a/core/modules/system/src/Tests/Entity/EntityOperationsTest.php b/core/modules/system/src/Tests/Entity/EntityOperationsTest.php
index 1d9fe1e..c3e94a3 100644
--- a/core/modules/system/src/Tests/Entity/EntityOperationsTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityOperationsTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -44,7 +45,7 @@ public function testEntityOperationAlter() {
     $roles = user_roles();
     foreach ($roles as $role) {
       $this->assertLinkByHref($role->url() . '/test_operation');
-      $this->assertLink(format_string('Test Operation: @label', array('@label' => $role->label())));
+      $this->assertLink(String::format('Test Operation: @label', array('@label' => $role->label())));
     }
   }
 
diff --git a/core/modules/system/src/Tests/Entity/EntityQueryTest.php b/core/modules/system/src/Tests/Entity/EntityQueryTest.php
index 422bfa7..e3b198c 100644
--- a/core/modules/system/src/Tests/Entity/EntityQueryTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityQueryTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\language\Entity\ConfigurableLanguage;
@@ -481,7 +482,7 @@ protected function assertBundleOrder($order) {
           }
         }
       }
-      $this->assertTrue($ok, format_string("$i is after all entities in bundle2"));
+      $this->assertTrue($ok, String::format("$i is after all entities in bundle2"));
     }
   }
 
diff --git a/core/modules/system/src/Tests/Entity/EntityRevisionsTest.php b/core/modules/system/src/Tests/Entity/EntityRevisionsTest.php
index d484c8b..ae47c8a 100644
--- a/core/modules/system/src/Tests/Entity/EntityRevisionsTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityRevisionsTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -80,9 +81,9 @@ protected function assertRevisions($entity_type) {
       $revision_ids[] = $entity->revision_id->value;
 
       // Check that the fields and properties contain new content.
-      $this->assertTrue($entity->revision_id->value > $legacy_revision_id, format_string('%entity_type: Revision ID changed.', array('%entity_type' => $entity_type)));
-      $this->assertNotEqual($entity->name->value, $legacy_name, format_string('%entity_type: Name changed.', array('%entity_type' => $entity_type)));
-      $this->assertNotEqual($entity->field_test_text->value, $legacy_text, format_string('%entity_type: Text changed.', array('%entity_type' => $entity_type)));
+      $this->assertTrue($entity->revision_id->value > $legacy_revision_id, String::format('%entity_type: Revision ID changed.', array('%entity_type' => $entity_type)));
+      $this->assertNotEqual($entity->name->value, $legacy_name, String::format('%entity_type: Name changed.', array('%entity_type' => $entity_type)));
+      $this->assertNotEqual($entity->field_test_text->value, $legacy_text, String::format('%entity_type: Text changed.', array('%entity_type' => $entity_type)));
     }
 
     for ($i = 0; $i < $revision_count; $i++) {
@@ -90,15 +91,15 @@ protected function assertRevisions($entity_type) {
       $entity_revision = entity_revision_load($entity_type, $revision_ids[$i]);
 
       // Check if properties and fields contain the revision specific content.
-      $this->assertEqual($entity_revision->revision_id->value, $revision_ids[$i], format_string('%entity_type: Revision ID matches.', array('%entity_type' => $entity_type)));
-      $this->assertEqual($entity_revision->name->value, $names[$i], format_string('%entity_type: Name matches.', array('%entity_type' => $entity_type)));
-      $this->assertEqual($entity_revision->field_test_text->value, $texts[$i], format_string('%entity_type: Text matches.', array('%entity_type' => $entity_type)));
+      $this->assertEqual($entity_revision->revision_id->value, $revision_ids[$i], String::format('%entity_type: Revision ID matches.', array('%entity_type' => $entity_type)));
+      $this->assertEqual($entity_revision->name->value, $names[$i], String::format('%entity_type: Name matches.', array('%entity_type' => $entity_type)));
+      $this->assertEqual($entity_revision->field_test_text->value, $texts[$i], String::format('%entity_type: Text matches.', array('%entity_type' => $entity_type)));
     }
 
     // Confirm the correct revision text appears in the edit form.
     $entity = entity_load($entity_type, $entity->id->value);
     $this->drupalGet($entity_type . '/manage/' . $entity->id->value);
-    $this->assertFieldById('edit-name-0-value', $entity->name->value, format_string('%entity_type: Name matches in UI.', array('%entity_type' => $entity_type)));
-    $this->assertFieldById('edit-field-test-text-0-value', $entity->field_test_text->value, format_string('%entity_type: Text matches in UI.', array('%entity_type' => $entity_type)));
+    $this->assertFieldById('edit-name-0-value', $entity->name->value, String::format('%entity_type: Name matches in UI.', array('%entity_type' => $entity_type)));
+    $this->assertFieldById('edit-field-test-text-0-value', $entity->field_test_text->value, String::format('%entity_type: Text matches in UI.', array('%entity_type' => $entity_type)));
   }
 }
diff --git a/core/modules/system/src/Tests/Entity/EntityTranslationTest.php b/core/modules/system/src/Tests/Entity/EntityTranslationTest.php
index 6d6b4a3..aa252dc 100644
--- a/core/modules/system/src/Tests/Entity/EntityTranslationTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityTranslationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\entity_test\Entity\EntityTestMulRev;
 use Drupal\language\Entity\ConfigurableLanguage;
@@ -39,55 +40,55 @@ protected function _testEntityLanguageMethods($entity_type) {
       'name' => 'test',
       'user_id' => $this->container->get('current_user')->id(),
     ));
-    $this->assertEqual($entity->language()->getId(), $this->languageManager->getDefaultLanguage()->getId(), format_string('%entity_type: Entity created with API has default language.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->language()->getId(), $this->languageManager->getDefaultLanguage()->getId(), String::format('%entity_type: Entity created with API has default language.', array('%entity_type' => $entity_type)));
     $entity = entity_create($entity_type, array(
       'name' => 'test',
       'user_id' => \Drupal::currentUser()->id(),
       'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
     ));
-    $this->assertEqual($entity->language()->getId(), LanguageInterface::LANGCODE_NOT_SPECIFIED, format_string('%entity_type: Entity language not specified.', array('%entity_type' => $entity_type)));
-    $this->assertFalse($entity->getTranslationLanguages(FALSE), format_string('%entity_type: No translations are available', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->language()->getId(), LanguageInterface::LANGCODE_NOT_SPECIFIED, String::format('%entity_type: Entity language not specified.', array('%entity_type' => $entity_type)));
+    $this->assertFalse($entity->getTranslationLanguages(FALSE), String::format('%entity_type: No translations are available', array('%entity_type' => $entity_type)));
 
     // Set the value in default language.
     $entity->set($this->field_name, array(0 => array('value' => 'default value')));
     // Get the value.
     $field = $entity->getTranslation(LanguageInterface::LANGCODE_DEFAULT)->get($this->field_name);
-    $this->assertEqual($field->value, 'default value', format_string('%entity_type: Untranslated value retrieved.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($field->getLangcode(), LanguageInterface::LANGCODE_NOT_SPECIFIED, format_string('%entity_type: Field object has the expected langcode.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($field->value, 'default value', String::format('%entity_type: Untranslated value retrieved.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($field->getLangcode(), LanguageInterface::LANGCODE_NOT_SPECIFIED, String::format('%entity_type: Field object has the expected langcode.', array('%entity_type' => $entity_type)));
 
     // Set the value in a certain language. As the entity is not
     // language-specific it should use the default language and so ignore the
     // specified language.
     $entity->getTranslation($this->langcodes[1])->set($this->field_name, array(0 => array('value' => 'default value2')));
-    $this->assertEqual($entity->get($this->field_name)->value, 'default value2', format_string('%entity_type: Untranslated value updated.', array('%entity_type' => $entity_type)));
-    $this->assertFalse($entity->getTranslationLanguages(FALSE), format_string('%entity_type: No translations are available', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->get($this->field_name)->value, 'default value2', String::format('%entity_type: Untranslated value updated.', array('%entity_type' => $entity_type)));
+    $this->assertFalse($entity->getTranslationLanguages(FALSE), String::format('%entity_type: No translations are available', array('%entity_type' => $entity_type)));
 
     // Test getting a field value using a specific language for a not
     // language-specific entity.
     $field = $entity->getTranslation($this->langcodes[1])->get($this->field_name);
-    $this->assertEqual($field->value, 'default value2', format_string('%entity_type: Untranslated value retrieved.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($field->getLangcode(), LanguageInterface::LANGCODE_NOT_SPECIFIED, format_string('%entity_type: Field object has the expected langcode.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($field->value, 'default value2', String::format('%entity_type: Untranslated value retrieved.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($field->getLangcode(), LanguageInterface::LANGCODE_NOT_SPECIFIED, String::format('%entity_type: Field object has the expected langcode.', array('%entity_type' => $entity_type)));
 
     // Now, make the entity language-specific by assigning a language and test
     // translating it.
     $default_langcode = $this->langcodes[0];
     $entity->langcode->value = $default_langcode;
     $entity->{$this->field_name} = array();
-    $this->assertEqual($entity->language(), \Drupal::languageManager()->getLanguage($this->langcodes[0]), format_string('%entity_type: Entity language retrieved.', array('%entity_type' => $entity_type)));
-    $this->assertFalse($entity->getTranslationLanguages(FALSE), format_string('%entity_type: No translations are available', array('%entity_type' => $entity_type)));
+    $this->assertEqual($entity->language(), \Drupal::languageManager()->getLanguage($this->langcodes[0]), String::format('%entity_type: Entity language retrieved.', array('%entity_type' => $entity_type)));
+    $this->assertFalse($entity->getTranslationLanguages(FALSE), String::format('%entity_type: No translations are available', array('%entity_type' => $entity_type)));
 
     // Set the value in default language.
     $entity->set($this->field_name, array(0 => array('value' => 'default value')));
     // Get the value.
     $field = $entity->get($this->field_name);
-    $this->assertEqual($field->value, 'default value', format_string('%entity_type: Untranslated value retrieved.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($field->getLangcode(), $default_langcode, format_string('%entity_type: Field object has the expected langcode.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($field->value, 'default value', String::format('%entity_type: Untranslated value retrieved.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($field->getLangcode(), $default_langcode, String::format('%entity_type: Field object has the expected langcode.', array('%entity_type' => $entity_type)));
 
     // Set a translation.
     $entity->getTranslation($this->langcodes[1])->set($this->field_name, array(0 => array('value' => 'translation 1')));
     $field = $entity->getTranslation($this->langcodes[1])->{$this->field_name};
-    $this->assertEqual($field->value, 'translation 1', format_string('%entity_type: Translated value set.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($field->getLangcode(), $this->langcodes[1], format_string('%entity_type: Field object has the expected langcode.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($field->value, 'translation 1', String::format('%entity_type: Translated value set.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($field->getLangcode(), $this->langcodes[1], String::format('%entity_type: Field object has the expected langcode.', array('%entity_type' => $entity_type)));
 
     // Make sure the untranslated value stays.
     $field = $entity->get($this->field_name);
@@ -98,7 +99,7 @@ protected function _testEntityLanguageMethods($entity_type) {
     $this->assertEqual($entity->getTranslationLanguages(FALSE), $translations, 'Translations retrieved.');
 
     // Try to get a not available translation.
-    $this->assertNull($entity->getTranslation($this->langcodes[2])->get($this->field_name)->value, format_string('%entity_type: A translation that is not available is NULL.', array('%entity_type' => $entity_type)));
+    $this->assertNull($entity->getTranslation($this->langcodes[2])->get($this->field_name)->value, String::format('%entity_type: A translation that is not available is NULL.', array('%entity_type' => $entity_type)));
 
     // Try to get a value using an invalid language code.
     try {
@@ -112,10 +113,10 @@ protected function _testEntityLanguageMethods($entity_type) {
     // Try to set a value using an invalid language code.
     try {
       $entity->getTranslation('invalid')->set($this->field_name, NULL);
-      $this->fail(format_string('%entity_type: Setting a translation for an invalid language throws an exception.', array('%entity_type' => $entity_type)));
+      $this->fail(String::format('%entity_type: Setting a translation for an invalid language throws an exception.', array('%entity_type' => $entity_type)));
     }
     catch (\InvalidArgumentException $e) {
-      $this->pass(format_string('%entity_type: Setting a translation for an invalid language throws an exception.', array('%entity_type' => $entity_type)));
+      $this->pass(String::format('%entity_type: Setting a translation for an invalid language throws an exception.', array('%entity_type' => $entity_type)));
     }
 
     // Set the value in default language.
@@ -123,8 +124,8 @@ protected function _testEntityLanguageMethods($entity_type) {
     $entity->getTranslation($this->langcodes[1])->set($field_name, array(0 => array('value' => 'default value2')));
     // Get the value.
     $field = $entity->get($field_name);
-    $this->assertEqual($field->value, 'default value2', format_string('%entity_type: Untranslated value set into a translation in non-strict mode.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($field->getLangcode(), $default_langcode, format_string('%entity_type: Field object has the expected langcode.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($field->value, 'default value2', String::format('%entity_type: Untranslated value set into a translation in non-strict mode.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($field->getLangcode(), $default_langcode, String::format('%entity_type: Field object has the expected langcode.', array('%entity_type' => $entity_type)));
   }
 
   /**
@@ -154,19 +155,19 @@ protected function _testMultilingualProperties($entity_type) {
     $entity->save();
     $entity = entity_load($entity_type, $entity->id());
     $default_langcode = $entity->language()->getId();
-    $this->assertEqual($default_langcode, LanguageInterface::LANGCODE_NOT_SPECIFIED, format_string('%entity_type: Entity created as language neutral.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($default_langcode, LanguageInterface::LANGCODE_NOT_SPECIFIED, String::format('%entity_type: Entity created as language neutral.', array('%entity_type' => $entity_type)));
     $field = $entity->getTranslation(LanguageInterface::LANGCODE_DEFAULT)->get('name');
-    $this->assertEqual($name, $field->value, format_string('%entity_type: The entity name has been correctly stored as language neutral.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($default_langcode, $field->getLangcode(), format_string('%entity_type: The field object has the expect langcode.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($uid, $entity->getTranslation(LanguageInterface::LANGCODE_DEFAULT)->get('user_id')->target_id, format_string('%entity_type: The entity author has been correctly stored as language neutral.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($name, $field->value, String::format('%entity_type: The entity name has been correctly stored as language neutral.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($default_langcode, $field->getLangcode(), String::format('%entity_type: The field object has the expect langcode.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($uid, $entity->getTranslation(LanguageInterface::LANGCODE_DEFAULT)->get('user_id')->target_id, String::format('%entity_type: The entity author has been correctly stored as language neutral.', array('%entity_type' => $entity_type)));
     $field = $entity->getTranslation($langcode)->get('name');
-    $this->assertEqual($name, $field->value, format_string('%entity_type: The entity name defaults to neutral language.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($default_langcode, $field->getLangcode(), format_string('%entity_type: The field object has the expect langcode.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($uid, $entity->getTranslation($langcode)->get('user_id')->target_id, format_string('%entity_type: The entity author defaults to neutral language.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($name, $field->value, String::format('%entity_type: The entity name defaults to neutral language.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($default_langcode, $field->getLangcode(), String::format('%entity_type: The field object has the expect langcode.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($uid, $entity->getTranslation($langcode)->get('user_id')->target_id, String::format('%entity_type: The entity author defaults to neutral language.', array('%entity_type' => $entity_type)));
     $field = $entity->get('name');
-    $this->assertEqual($name, $field->value, format_string('%entity_type: The entity name can be retrieved without specifying a language.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($default_langcode, $field->getLangcode(), format_string('%entity_type: The field object has the expect langcode.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($uid, $entity->get('user_id')->target_id, format_string('%entity_type: The entity author can be retrieved without specifying a language.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($name, $field->value, String::format('%entity_type: The entity name can be retrieved without specifying a language.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($default_langcode, $field->getLangcode(), String::format('%entity_type: The field object has the expect langcode.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($uid, $entity->get('user_id')->target_id, String::format('%entity_type: The entity author can be retrieved without specifying a language.', array('%entity_type' => $entity_type)));
 
     // Create a language-aware entity and check that properties are stored
     // as language-aware.
@@ -174,21 +175,21 @@ protected function _testMultilingualProperties($entity_type) {
     $entity->save();
     $entity = entity_load($entity_type, $entity->id());
     $default_langcode = $entity->language()->getId();
-    $this->assertEqual($default_langcode, $langcode, format_string('%entity_type: Entity created as language specific.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($default_langcode, $langcode, String::format('%entity_type: Entity created as language specific.', array('%entity_type' => $entity_type)));
     $field = $entity->getTranslation($langcode)->get('name');
-    $this->assertEqual($name, $field->value, format_string('%entity_type: The entity name has been correctly stored as a language-aware property.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($default_langcode, $field->getLangcode(), format_string('%entity_type: The field object has the expect langcode.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($uid, $entity->getTranslation($langcode)->get('user_id')->target_id, format_string('%entity_type: The entity author has been correctly stored as a language-aware property.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($name, $field->value, String::format('%entity_type: The entity name has been correctly stored as a language-aware property.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($default_langcode, $field->getLangcode(), String::format('%entity_type: The field object has the expect langcode.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($uid, $entity->getTranslation($langcode)->get('user_id')->target_id, String::format('%entity_type: The entity author has been correctly stored as a language-aware property.', array('%entity_type' => $entity_type)));
     // Translatable properties on a translatable entity should use default
     // language if LanguageInterface::LANGCODE_NOT_SPECIFIED is passed.
     $field = $entity->getTranslation(LanguageInterface::LANGCODE_NOT_SPECIFIED)->get('name');
-    $this->assertEqual($name, $field->value, format_string('%entity_type: The entity name defaults to the default language.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($default_langcode, $field->getLangcode(), format_string('%entity_type: The field object has the expect langcode.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($uid, $entity->getTranslation(LanguageInterface::LANGCODE_NOT_SPECIFIED)->get('user_id')->target_id, format_string('%entity_type: The entity author defaults to the default language.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($name, $field->value, String::format('%entity_type: The entity name defaults to the default language.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($default_langcode, $field->getLangcode(), String::format('%entity_type: The field object has the expect langcode.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($uid, $entity->getTranslation(LanguageInterface::LANGCODE_NOT_SPECIFIED)->get('user_id')->target_id, String::format('%entity_type: The entity author defaults to the default language.', array('%entity_type' => $entity_type)));
     $field = $entity->get('name');
-    $this->assertEqual($name, $field->value, format_string('%entity_type: The entity name can be retrieved without specifying a language.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($default_langcode, $field->getLangcode(), format_string('%entity_type: The field object has the expect langcode.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($uid, $entity->get('user_id')->target_id, format_string('%entity_type: The entity author can be retrieved without specifying a language.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($name, $field->value, String::format('%entity_type: The entity name can be retrieved without specifying a language.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($default_langcode, $field->getLangcode(), String::format('%entity_type: The field object has the expect langcode.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($uid, $entity->get('user_id')->target_id, String::format('%entity_type: The entity author can be retrieved without specifying a language.', array('%entity_type' => $entity_type)));
 
     // Create property translations.
     $properties = array();
@@ -221,10 +222,10 @@ protected function _testMultilingualProperties($entity_type) {
         '%langcode' => $langcode,
       );
       $field = $entity->getTranslation($langcode)->get('name');
-      $this->assertEqual($properties[$langcode]['name'][0], $field->value, format_string('%entity_type: The entity name has been correctly stored for language %langcode.', $args));
+      $this->assertEqual($properties[$langcode]['name'][0], $field->value, String::format('%entity_type: The entity name has been correctly stored for language %langcode.', $args));
       $field_langcode = ($langcode == $entity->language()->getId()) ? $default_langcode : $langcode;
-      $this->assertEqual($field_langcode, $field->getLangcode(), format_string('%entity_type: The field object has the expected langcode  %langcode.', $args));
-      $this->assertEqual($properties[$langcode]['user_id'][0], $entity->getTranslation($langcode)->get('user_id')->target_id, format_string('%entity_type: The entity author has been correctly stored for language %langcode.', $args));
+      $this->assertEqual($field_langcode, $field->getLangcode(), String::format('%entity_type: The field object has the expected langcode  %langcode.', $args));
+      $this->assertEqual($properties[$langcode]['user_id'][0], $entity->getTranslation($langcode)->get('user_id')->target_id, String::format('%entity_type: The entity author has been correctly stored for language %langcode.', $args));
     }
 
     // Test query conditions (cache is reset at each call).
@@ -239,24 +240,24 @@ protected function _testMultilingualProperties($entity_type) {
     ))->save();
 
     $entities = entity_load_multiple($entity_type);
-    $this->assertEqual(count($entities), 3, format_string('%entity_type: Three entities were created.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(count($entities), 3, String::format('%entity_type: Three entities were created.', array('%entity_type' => $entity_type)));
     $entities = entity_load_multiple($entity_type, array($translated_id));
-    $this->assertEqual(count($entities), 1, format_string('%entity_type: One entity correctly loaded by id.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(count($entities), 1, String::format('%entity_type: One entity correctly loaded by id.', array('%entity_type' => $entity_type)));
     $entities = entity_load_multiple_by_properties($entity_type, array('name' => $name));
-    $this->assertEqual(count($entities), 2, format_string('%entity_type: Two entities correctly loaded by name.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(count($entities), 2, String::format('%entity_type: Two entities correctly loaded by name.', array('%entity_type' => $entity_type)));
     // @todo The default language condition should go away in favor of an
     // explicit parameter.
     $entities = entity_load_multiple_by_properties($entity_type, array('name' => $properties[$langcode]['name'][0], 'default_langcode' => 0));
-    $this->assertEqual(count($entities), 1, format_string('%entity_type: One entity correctly loaded by name translation.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(count($entities), 1, String::format('%entity_type: One entity correctly loaded by name translation.', array('%entity_type' => $entity_type)));
     $entities = entity_load_multiple_by_properties($entity_type, array('langcode' => $default_langcode, 'name' => $name));
-    $this->assertEqual(count($entities), 1, format_string('%entity_type: One entity correctly loaded by name and language.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(count($entities), 1, String::format('%entity_type: One entity correctly loaded by name and language.', array('%entity_type' => $entity_type)));
 
     $entities = entity_load_multiple_by_properties($entity_type, array('langcode' => $langcode, 'name' => $properties[$langcode]['name'][0]));
-    $this->assertEqual(count($entities), 0, format_string('%entity_type: No entity loaded by name translation specifying the translation language.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(count($entities), 0, String::format('%entity_type: No entity loaded by name translation specifying the translation language.', array('%entity_type' => $entity_type)));
     $entities = entity_load_multiple_by_properties($entity_type, array('langcode' => $langcode, 'name' => $properties[$langcode]['name'][0], 'default_langcode' => 0));
-    $this->assertEqual(count($entities), 1, format_string('%entity_type: One entity loaded by name translation and language specifying to look for translations.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(count($entities), 1, String::format('%entity_type: One entity loaded by name translation and language specifying to look for translations.', array('%entity_type' => $entity_type)));
     $entities = entity_load_multiple_by_properties($entity_type, array('user_id' => $properties[$langcode]['user_id'][0], 'default_langcode' => NULL));
-    $this->assertEqual(count($entities), 2, format_string('%entity_type: Two entities loaded by uid without caring about property translatability.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(count($entities), 2, String::format('%entity_type: Two entities loaded by uid without caring about property translatability.', array('%entity_type' => $entity_type)));
 
     // Test property conditions and orders with multiple languages in the same
     // query.
@@ -268,7 +269,7 @@ protected function _testMultilingualProperties($entity_type) {
       ->condition($group)
       ->condition('name', $properties[$langcode]['name'], '=', $langcode)
       ->execute();
-    $this->assertEqual(count($result), 1, format_string('%entity_type: One entity loaded by name and uid using different language meta conditions.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(count($result), 1, String::format('%entity_type: One entity loaded by name and uid using different language meta conditions.', array('%entity_type' => $entity_type)));
 
     // Test mixed property and field conditions.
     $entity = entity_load($entity_type, reset($result), TRUE);
@@ -287,7 +288,7 @@ protected function _testMultilingualProperties($entity_type) {
       ->condition($default_langcode_group)
       ->condition($langcode_group)
       ->execute();
-    $this->assertEqual(count($result), 1, format_string('%entity_type: One entity loaded by name, uid and field value using different language meta conditions.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(count($result), 1, String::format('%entity_type: One entity loaded by name, uid and field value using different language meta conditions.', array('%entity_type' => $entity_type)));
   }
 
   /**
@@ -358,7 +359,7 @@ function testEntityTranslationAPI() {
     $translation = $entity->getTranslation($langcode2);
     $entity->removeTranslation($langcode2);
     foreach (array('get', 'set', '__get', '__set', 'createDuplicate') as $method) {
-      $message = format_string('The @method method raises an exception when trying to manipulate a removed translation.', array('@method' => $method));
+      $message = String::format('The @method method raises an exception when trying to manipulate a removed translation.', array('@method' => $method));
       try {
         $translation->{$method}('name', $this->randomMachineName());
         $this->fail($message);
@@ -380,7 +381,7 @@ function testEntityTranslationAPI() {
     // Check that removing an invalid translation causes an exception to be
     // thrown.
     foreach (array($default_langcode, LanguageInterface::LANGCODE_DEFAULT, $this->randomMachineName()) as $invalid_langcode) {
-      $message = format_string('Removing an invalid translation (@langcode) causes an exception to be thrown.', array('@langcode' => $invalid_langcode));
+      $message = String::format('Removing an invalid translation (@langcode) causes an exception to be thrown.', array('@langcode' => $invalid_langcode));
       try {
         $entity->removeTranslation($invalid_langcode);
         $this->fail($message);
@@ -548,7 +549,7 @@ function testFieldDefinitions() {
     foreach (array('id', 'uuid', 'revision_id', 'type', 'langcode') as $name) {
       $this->state->set('entity_test.field_definitions.translatable', array($name => TRUE));
       $this->entityManager->clearCachedFieldDefinitions();
-      $message = format_string('Field %field cannot be translatable.', array('%field' => $name));
+      $message = String::format('Field %field cannot be translatable.', array('%field' => $name));
 
       try {
         $this->entityManager->getBaseFieldDefinitions($entity_type);
diff --git a/core/modules/system/src/Tests/Extension/ModuleHandlerTest.php b/core/modules/system/src/Tests/Extension/ModuleHandlerTest.php
index 69f5627..12d1e6f 100644
--- a/core/modules/system/src/Tests/Extension/ModuleHandlerTest.php
+++ b/core/modules/system/src/Tests/Extension/ModuleHandlerTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Extension;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\simpletest\KernelTestBase;
 use Symfony\Component\HttpFoundation\Response;
@@ -86,7 +87,7 @@ protected function assertModuleList(Array $expected_values, $condition) {
     $expected_values = array_values(array_unique($expected_values));
     $enabled_modules = array_keys($this->container->get('module_handler')->getModuleList());
     $enabled_modules = sort($enabled_modules);
-    $this->assertEqual($expected_values, $enabled_modules, format_string('@condition: extension handler returns correct results', array('@condition' => $condition)));
+    $this->assertEqual($expected_values, $enabled_modules, String::format('@condition: extension handler returns correct results', array('@condition' => $condition)));
   }
 
   /**
diff --git a/core/modules/system/src/Tests/File/DirectoryTest.php b/core/modules/system/src/Tests/File/DirectoryTest.php
index 158be71..75193c0 100644
--- a/core/modules/system/src/Tests/File/DirectoryTest.php
+++ b/core/modules/system/src/Tests/File/DirectoryTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\system\Tests\File;
+use Drupal\Component\Utility\String;
 
 /**
  * Tests operations dealing with directories.
@@ -107,14 +108,14 @@ function testFileCreateNewFilepath() {
     $directory = 'core/misc';
     $original = $directory . '/' . $basename;
     $path = file_create_filename($basename, $directory);
-    $this->assertEqual($path, $original, format_string('New filepath %new equals %original.', array('%new' => $path, '%original' => $original)), 'File');
+    $this->assertEqual($path, $original, String::format('New filepath %new equals %original.', array('%new' => $path, '%original' => $original)), 'File');
 
     // Then we test against a file that already exists within that directory.
     $basename = 'druplicon.png';
     $original = $directory . '/' . $basename;
     $expected = $directory . '/druplicon_0.png';
     $path = file_create_filename($basename, $directory);
-    $this->assertEqual($path, $expected, format_string('Creating a new filepath from %original equals %new (expected %expected).', array('%new' => $path, '%original' => $original, '%expected' => $expected)), 'File');
+    $this->assertEqual($path, $expected, String::format('Creating a new filepath from %original equals %new (expected %expected).', array('%new' => $path, '%original' => $original, '%expected' => $expected)), 'File');
 
     // @TODO: Finally we copy a file into a directory several times, to ensure a properly iterating filename suffix.
   }
diff --git a/core/modules/system/src/Tests/File/MimeTypeTest.php b/core/modules/system/src/Tests/File/MimeTypeTest.php
index f09b60d..996c3fa 100644
--- a/core/modules/system/src/Tests/File/MimeTypeTest.php
+++ b/core/modules/system/src/Tests/File/MimeTypeTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\system\Tests\File;
+use Drupal\Component\Utility\String;
 
 /**
  * Tests filename mimetype detection.
@@ -49,11 +50,11 @@ public function testFileMimeTypeDetection() {
     foreach ($test_case as $input => $expected) {
       // Test stream [URI].
       $output = $guesser->guess($prefix . $input);
-      $this->assertIdentical($output, $expected, format_string('Mimetype for %input is %output (expected: %expected).', array('%input' => $input, '%output' => $output, '%expected' => $expected)));
+      $this->assertIdentical($output, $expected, String::format('Mimetype for %input is %output (expected: %expected).', array('%input' => $input, '%output' => $output, '%expected' => $expected)));
 
       // Test normal path equivalent
       $output = $guesser->guess($input);
-      $this->assertIdentical($output, $expected, format_string('Mimetype (using default mappings) for %input is %output (expected: %expected).', array('%input' => $input, '%output' => $output, '%expected' => $expected)));
+      $this->assertIdentical($output, $expected, String::format('Mimetype (using default mappings) for %input is %output (expected: %expected).', array('%input' => $input, '%output' => $output, '%expected' => $expected)));
     }
 
     // Now test the extension gusser by passing in a custom mapping.
@@ -88,7 +89,7 @@ public function testFileMimeTypeDetection() {
 
     foreach ($test_case as $input => $expected) {
       $output = $extension_guesser->guess($input);
-      $this->assertIdentical($output, $expected, format_string('Mimetype (using passed-in mappings) for %input is %output (expected: %expected).', array('%input' => $input, '%output' => $output, '%expected' => $expected)));
+      $this->assertIdentical($output, $expected, String::format('Mimetype (using passed-in mappings) for %input is %output (expected: %expected).', array('%input' => $input, '%output' => $output, '%expected' => $expected)));
     }
   }
 }
diff --git a/core/modules/system/src/Tests/File/NameMungingTest.php b/core/modules/system/src/Tests/File/NameMungingTest.php
index bd6a1d9..40734d3 100644
--- a/core/modules/system/src/Tests/File/NameMungingTest.php
+++ b/core/modules/system/src/Tests/File/NameMungingTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\system\Tests\File;
+use Drupal\Component\Utility\String;
 
 /**
  * Tests filename munging and unmunging.
@@ -45,7 +46,7 @@ function testMunging() {
     $munged_name = file_munge_filename($this->name, '', TRUE);
     $messages = drupal_get_messages();
     $this->assertTrue(in_array(t('For security reasons, your upload has been renamed to %filename.', array('%filename' => $munged_name)), $messages['status']), 'Alert properly set when a file is renamed.');
-    $this->assertNotEqual($munged_name, $this->name, format_string('The new filename (%munged) has been modified from the original (%original)', array('%munged' => $munged_name, '%original' => $this->name)));
+    $this->assertNotEqual($munged_name, $this->name, String::format('The new filename (%munged) has been modified from the original (%original)', array('%munged' => $munged_name, '%original' => $this->name)));
   }
 
   /**
@@ -64,7 +65,7 @@ function testMungeNullByte() {
   function testMungeIgnoreInsecure() {
     \Drupal::config('system.file')->set('allow_insecure_uploads', 1)->save();
     $munged_name = file_munge_filename($this->name, '');
-    $this->assertIdentical($munged_name, $this->name, format_string('The original filename (%original) matches the munged filename (%munged) when insecure uploads are enabled.', array('%munged' => $munged_name, '%original' => $this->name)));
+    $this->assertIdentical($munged_name, $this->name, String::format('The original filename (%original) matches the munged filename (%munged) when insecure uploads are enabled.', array('%munged' => $munged_name, '%original' => $this->name)));
   }
 
   /**
@@ -74,10 +75,10 @@ function testMungeIgnoreWhitelisted() {
     // Declare our extension as whitelisted. The declared extensions should
     // be case insensitive so test using one with a different case.
     $munged_name = file_munge_filename($this->name_with_uc_ext, $this->bad_extension);
-    $this->assertIdentical($munged_name, $this->name_with_uc_ext, format_string('The new filename (%munged) matches the original (%original) once the extension has been whitelisted.', array('%munged' => $munged_name, '%original' => $this->name_with_uc_ext)));
+    $this->assertIdentical($munged_name, $this->name_with_uc_ext, String::format('The new filename (%munged) matches the original (%original) once the extension has been whitelisted.', array('%munged' => $munged_name, '%original' => $this->name_with_uc_ext)));
     // The allowed extensions should also be normalized.
     $munged_name = file_munge_filename($this->name, strtoupper($this->bad_extension));
-    $this->assertIdentical($munged_name, $this->name, format_string('The new filename (%munged) matches the original (%original) also when the whitelisted extension is in uppercase.', array('%munged' => $munged_name, '%original' => $this->name)));
+    $this->assertIdentical($munged_name, $this->name, String::format('The new filename (%munged) matches the original (%original) also when the whitelisted extension is in uppercase.', array('%munged' => $munged_name, '%original' => $this->name)));
   }
 
   /**
@@ -86,6 +87,6 @@ function testMungeIgnoreWhitelisted() {
   function testUnMunge() {
     $munged_name = file_munge_filename($this->name, '', FALSE);
     $unmunged_name = file_unmunge_filename($munged_name);
-    $this->assertIdentical($unmunged_name, $this->name, format_string('The unmunged (%unmunged) filename matches the original (%original)', array('%unmunged' => $unmunged_name, '%original' => $this->name)));
+    $this->assertIdentical($unmunged_name, $this->name, String::format('The unmunged (%unmunged) filename matches the original (%original)', array('%unmunged' => $unmunged_name, '%original' => $this->name)));
   }
 }
diff --git a/core/modules/system/src/Tests/Form/CheckboxTest.php b/core/modules/system/src/Tests/Form/CheckboxTest.php
index da53a79..0abced0 100644
--- a/core/modules/system/src/Tests/Form/CheckboxTest.php
+++ b/core/modules/system/src/Tests/Form/CheckboxTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -53,7 +54,7 @@ function testFormCheckbox() {
           $checked = ($default_value === '1foobar');
         }
         $checked_in_html = strpos($form, 'checked') !== FALSE;
-        $message = format_string('#default_value is %default_value #return_value is %return_value.', array('%default_value' => var_export($default_value, TRUE), '%return_value' => var_export($return_value, TRUE)));
+        $message = String::format('#default_value is %default_value #return_value is %return_value.', array('%default_value' => var_export($default_value, TRUE), '%return_value' => var_export($return_value, TRUE)));
         $this->assertIdentical($checked, $checked_in_html, $message);
       }
     }
@@ -75,7 +76,7 @@ function testFormCheckbox() {
     foreach ($checkboxes as $checkbox) {
       $checked = isset($checkbox['checked']);
       $name = (string) $checkbox['name'];
-      $this->assertIdentical($checked, $name == 'checkbox_zero_default[0]' || $name == 'checkbox_string_zero_default[0]', format_string('Checkbox %name correctly checked', array('%name' => $name)));
+      $this->assertIdentical($checked, $name == 'checkbox_zero_default[0]' || $name == 'checkbox_string_zero_default[0]', String::format('Checkbox %name correctly checked', array('%name' => $name)));
     }
     $edit = array('checkbox_off[0]' => '0');
     $this->drupalPostForm('form-test/checkboxes-zero/0', $edit, 'Save');
@@ -83,7 +84,7 @@ function testFormCheckbox() {
     foreach ($checkboxes as $checkbox) {
       $checked = isset($checkbox['checked']);
       $name = (string) $checkbox['name'];
-      $this->assertIdentical($checked, $name == 'checkbox_off[0]' || $name == 'checkbox_zero_default[0]' || $name == 'checkbox_string_zero_default[0]', format_string('Checkbox %name correctly checked', array('%name' => $name)));
+      $this->assertIdentical($checked, $name == 'checkbox_off[0]' || $name == 'checkbox_zero_default[0]' || $name == 'checkbox_string_zero_default[0]', String::format('Checkbox %name correctly checked', array('%name' => $name)));
     }
   }
 }
diff --git a/core/modules/system/src/Tests/Form/ElementTest.php b/core/modules/system/src/Tests/Form/ElementTest.php
index 9fa7eca..2a853dc 100644
--- a/core/modules/system/src/Tests/Form/ElementTest.php
+++ b/core/modules/system/src/Tests/Form/ElementTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -35,7 +36,7 @@ function testPlaceHolderText() {
         ':id' => 'edit-' . $type,
         ':expected' => $expected,
       ));
-      $this->assertTrue(!empty($element), format_string('Placeholder text placed in @type.', array('@type' => $type)));
+      $this->assertTrue(!empty($element), String::format('Placeholder text placed in @type.', array('@type' => $type)));
     }
 
     // Test to make sure textarea has the proper placeholder text.
@@ -81,7 +82,7 @@ function testOptions() {
         ':id' => 'edit-' . $type . '-foo',
         ':class' => 'description',
       ));
-      $this->assertTrue(count($elements), format_string('Custom %type option description found.', array(
+      $this->assertTrue(count($elements), String::format('Custom %type option description found.', array(
         '%type' => $type,
       )));
     }
@@ -97,8 +98,8 @@ function testWrapperIds() {
     foreach (array('checkboxes', 'radios') as $type) {
       $element_ids = $this->xpath('//div[@id=:id]', array(':id' => 'edit-' . $type));
       $wrapper_ids = $this->xpath('//fieldset[@id=:id]', array(':id' => 'edit-' . $type . '--wrapper'));
-      $this->assertTrue(count($element_ids) == 1, format_string('A single element id found for type %type', array('%type' => $type)));
-      $this->assertTrue(count($wrapper_ids) == 1, format_string('A single wrapper id found for type %type', array('%type' => $type)));
+      $this->assertTrue(count($element_ids) == 1, String::format('A single element id found for type %type', array('%type' => $type)));
+      $this->assertTrue(count($wrapper_ids) == 1, String::format('A single wrapper id found for type %type', array('%type' => $type)));
     }
   }
 
diff --git a/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php b/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php
index e9c66f3..a26c588 100644
--- a/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php
+++ b/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Form\FormState;
 use Drupal\simpletest\WebTestBase;
 use Drupal\Core\Form\FormStateInterface;
@@ -39,7 +40,7 @@ function testMultipleTrue() {
 
     $rows = array('row1', 'row2', 'row3');
     foreach ($rows as $row) {
-      $this->assertFieldByXPath('//input[@type="checkbox"]', $row, format_string('Checkbox for value @row.', array('@row' => $row)));
+      $this->assertFieldByXPath('//input[@type="checkbox"]', $row, String::format('Checkbox for value @row.', array('@row' => $row)));
     }
   }
 
@@ -56,7 +57,7 @@ function testMultipleFalse() {
 
     $rows = array('row1', 'row2', 'row3');
     foreach ($rows as $row) {
-      $this->assertFieldByXPath('//input[@type="radio"]', $row, format_string('Radio button for value @row.', array('@row' => $row)));
+      $this->assertFieldByXPath('//input[@type="radio"]', $row, String::format('Radio button for value @row.', array('@row' => $row)));
     }
   }
 
@@ -78,7 +79,7 @@ function testTableselectColSpan() {
     // radio, one cell in the first column, one cell in the the second column,
     // and two cells in the third column which has colspan 2.
     for ( $i = 0; $i <= 1; $i++) {
-      $this->assertEqual(count($table_body[0]->tr[$i]->td), 5, format_string('There are five cells in row @row.', array('@row' => $i)));
+      $this->assertEqual(count($table_body[0]->tr[$i]->td), 5, String::format('There are five cells in row @row.', array('@row' => $i)));
     }
     // The third row should have 3 cells, one for the radio, one spanning the
     // first and second column, and a third in column 3 (which has colspan 3).
diff --git a/core/modules/system/src/Tests/Form/FormTest.php b/core/modules/system/src/Tests/Form/FormTest.php
index a377e6e..cefed7e 100644
--- a/core/modules/system/src/Tests/Form/FormTest.php
+++ b/core/modules/system/src/Tests/Form/FormTest.php
@@ -192,7 +192,7 @@ function testRequiredCheckboxesRadio() {
       $expected_key = array_search($error[0], $expected);
       // If the error message is not one of the expected messages, fail.
       if ($expected_key === FALSE) {
-        $this->fail(format_string("Unexpected error message: @error", array('@error' => $error[0])));
+        $this->fail(String::format("Unexpected error message: @error", array('@error' => $error[0])));
       }
       // Remove the expected message from the list once it is found.
       else {
@@ -202,7 +202,7 @@ function testRequiredCheckboxesRadio() {
 
     // Fail if any expected messages were not found.
     foreach ($expected as $not_found) {
-      $this->fail(format_string("Found error message: @error", array('@error' => $not_found)));
+      $this->fail(String::format("Found error message: @error", array('@error' => $not_found)));
     }
 
     // Verify that input elements are still empty.
@@ -284,7 +284,7 @@ function testCheckboxProcessing() {
       'zero_checkbox_off' => '',
     );
     foreach ($expected_values as $widget => $expected_value) {
-      $this->assertEqual($values[$widget], $expected_value, format_string('Checkbox %widget returns expected value (expected: %expected, got: %value)', array(
+      $this->assertEqual($values[$widget], $expected_value, String::format('Checkbox %widget returns expected value (expected: %expected, got: %value)', array(
         '%widget' => var_export($widget, TRUE),
         '%expected' => var_export($expected_value, TRUE),
         '%value' => var_export($values[$widget], TRUE),
@@ -358,7 +358,7 @@ function testSelect() {
       'multiple_no_default_required' => array('three' => 'three'),
     );
     foreach ($expected as $key => $value) {
-      $this->assertIdentical($values[$key], $value, format_string('@name: @actual is equal to @expected.', array(
+      $this->assertIdentical($values[$key], $value, String::format('@name: @actual is equal to @expected.', array(
         '@name' => $key,
         '@actual' => var_export($values[$key], TRUE),
         '@expected' => var_export($value, TRUE),
@@ -429,10 +429,10 @@ function testNumber() {
           // Check if the error exists on the page, if the current message ID is
           // expected. Otherwise ensure that the error message is not present.
           if ($id === $error) {
-            $this->assertRaw(format_string($message, $placeholders));
+            $this->assertRaw(String::format($message, $placeholders));
           }
           else {
-            $this->assertNoRaw(format_string($message, $placeholders));
+            $this->assertNoRaw(String::format($message, $placeholders));
           }
         }
       }
@@ -565,7 +565,7 @@ function assertFormValuesDefault($values, $form) {
           // Checkboxes values are not filtered out.
           $values[$key] = array_filter($values[$key]);
         }
-        $this->assertIdentical($expected_value, $values[$key], format_string('Default value for %type: expected %expected, returned %returned.', array('%type' => $key, '%expected' => var_export($expected_value, TRUE), '%returned' => var_export($values[$key], TRUE))));
+        $this->assertIdentical($expected_value, $values[$key], String::format('Default value for %type: expected %expected, returned %returned.', array('%type' => $key, '%expected' => var_export($expected_value, TRUE), '%returned' => var_export($values[$key], TRUE))));
       }
 
       // Recurse children.
@@ -619,7 +619,7 @@ function testDisabledMarkup() {
         ':div-class' => $class,
         ':value' => isset($item['#value']) ? $item['#value'] : '',
       ));
-      $this->assertTrue(isset($element[0]), format_string('Disabled form element class found for #type %type.', array('%type' => $item['#type'])));
+      $this->assertTrue(isset($element[0]), String::format('Disabled form element class found for #type %type.', array('%type' => $item['#type'])));
     }
 
     // Verify special element #type text-format.
@@ -627,12 +627,12 @@ function testDisabledMarkup() {
       ':name' => 'text_format[value]',
       ':div-class' => 'form-disabled',
     ));
-    $this->assertTrue(isset($element[0]), format_string('Disabled form element class found for #type %type.', array('%type' => 'text_format[value]')));
+    $this->assertTrue(isset($element[0]), String::format('Disabled form element class found for #type %type.', array('%type' => 'text_format[value]')));
     $element = $this->xpath('//div[contains(@class, :div-class)]/descendant::select[@name=:name]', array(
       ':name' => 'text_format[format]',
       ':div-class' => 'form-disabled',
     ));
-    $this->assertTrue(isset($element[0]), format_string('Disabled form element class found for #type %type.', array('%type' => 'text_format[format]')));
+    $this->assertTrue(isset($element[0]), String::format('Disabled form element class found for #type %type.', array('%type' => 'text_format[format]')));
   }
 
   /**
@@ -660,7 +660,7 @@ function testRequiredAttribute() {
         ':id' => 'edit-' . $type,
         ':expected' => $expected,
       ));
-      $this->assertTrue(!empty($element), format_string('The @type has the proper required attribute.', array('@type' => $type)));
+      $this->assertTrue(!empty($element), String::format('The @type has the proper required attribute.', array('@type' => $type)));
     }
 
     // Test to make sure textarea has the proper required attribute.
diff --git a/core/modules/system/src/Tests/Form/LanguageSelectElementTest.php b/core/modules/system/src/Tests/Form/LanguageSelectElementTest.php
index 1ebed3b..56fc0ff 100644
--- a/core/modules/system/src/Tests/Form/LanguageSelectElementTest.php
+++ b/core/modules/system/src/Tests/Form/LanguageSelectElementTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Tests\Form;
 
 use Drupal\Component\Serialization\Json;
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\simpletest\WebTestBase;
@@ -53,7 +54,7 @@ function testLanguageSelectElementOptions() {
         'edit-languages-config-and-locked' => LanguageInterface::STATE_CONFIGURABLE | LanguageInterface::STATE_LOCKED
     );
     foreach ($ids as $id => $flags) {
-      $this->assertField($id, format_string('The @id field was found on the page.', array('@id' => $id)));
+      $this->assertField($id, String::format('The @id field was found on the page.', array('@id' => $id)));
       $options = array();
       /* @var $language_manager \Drupal\Core\Language\LanguageManagerInterface */
       $language_manager = $this->container->get('language_manager');
@@ -64,7 +65,7 @@ function testLanguageSelectElementOptions() {
     }
 
     // Test that the #options were not altered by #languages.
-    $this->assertField('edit-language-custom-options', format_string('The @id field was found on the page.', array('@id' => 'edit-language-custom-options')));
+    $this->assertField('edit-language-custom-options', String::format('The @id field was found on the page.', array('@id' => 'edit-language-custom-options')));
     $this->_testLanguageSelectElementOptions('edit-language-custom-options', array('opt1' => 'First option', 'opt2' => 'Second option', 'opt3' => 'Third option'));
   }
 
@@ -81,7 +82,7 @@ function testHiddenLanguageSelectElement() {
     // Check that the language fields were rendered on the page.
     $ids = array('edit-languages-all', 'edit-languages-configurable', 'edit-languages-locked', 'edit-languages-config-and-locked');
     foreach ($ids as $id) {
-      $this->assertNoField($id, format_string('The @id field was not found on the page.', array('@id' => $id)));
+      $this->assertNoField($id, String::format('The @id field was not found on the page.', array('@id' => $id)));
     }
 
     // Check that the submitted values were the default values of the language
@@ -116,6 +117,6 @@ protected function _testLanguageSelectElementOptions($id, $options) {
       $this->assertEqual((string) $option, $option_title);
       next($options);
     }
-    $this->assertEqual($count, count($options), format_string('The number of languages and the number of options shown by the language element are the same: @languages languages, @number options', array('@languages' => count($options), '@number' => $count)));
+    $this->assertEqual($count, count($options), String::format('The number of languages and the number of options shown by the language element are the same: @languages languages, @number options', array('@languages' => count($options), '@number' => $count)));
   }
 }
diff --git a/core/modules/system/src/Tests/Form/ProgrammaticTest.php b/core/modules/system/src/Tests/Form/ProgrammaticTest.php
index ef8130c..cfb8ea9 100644
--- a/core/modules/system/src/Tests/Form/ProgrammaticTest.php
+++ b/core/modules/system/src/Tests/Form/ProgrammaticTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Form\FormState;
 use Drupal\simpletest\WebTestBase;
 
@@ -82,14 +83,14 @@ private function submitForm($values, $valid_input) {
       '%values' => print_r($values, TRUE),
       '%errors' => $valid_form ? t('None') : implode(' ', $errors),
     );
-    $this->assertTrue($valid_input == $valid_form, format_string('Input values: %values<br />Validation handler errors: %errors', $args));
+    $this->assertTrue($valid_input == $valid_form, String::format('Input values: %values<br />Validation handler errors: %errors', $args));
 
     // We check submitted values only if we have a valid input.
     if ($valid_input) {
       // Fetching the values that were set in the submission handler.
       $stored_values = $form_state->get('programmatic_form_submit');
       foreach ($values as $key => $value) {
-        $this->assertEqual($stored_values[$key], $value, format_string('Submission handler correctly executed: %stored_key is %stored_value', array('%stored_key' => $key, '%stored_value' => print_r($value, TRUE))));
+        $this->assertEqual($stored_values[$key], $value, String::format('Submission handler correctly executed: %stored_key is %stored_value', array('%stored_key' => $key, '%stored_value' => print_r($value, TRUE))));
       }
     }
   }
diff --git a/core/modules/system/src/Tests/Form/StateValuesCleanTest.php b/core/modules/system/src/Tests/Form/StateValuesCleanTest.php
index 382abfc..bc1ede6 100644
--- a/core/modules/system/src/Tests/Form/StateValuesCleanTest.php
+++ b/core/modules/system/src/Tests/Form/StateValuesCleanTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Tests\Form;
 
 use Drupal\Component\Serialization\Json;
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -38,16 +39,16 @@ function testFormStateValuesClean() {
     );
 
     // Verify that all internal Form API elements were removed.
-    $this->assertFalse(isset($values['form_id']), format_string('%element was removed.', array('%element' => 'form_id')));
-    $this->assertFalse(isset($values['form_token']), format_string('%element was removed.', array('%element' => 'form_token')));
-    $this->assertFalse(isset($values['form_build_id']), format_string('%element was removed.', array('%element' => 'form_build_id')));
-    $this->assertFalse(isset($values['op']), format_string('%element was removed.', array('%element' => 'op')));
+    $this->assertFalse(isset($values['form_id']), String::format('%element was removed.', array('%element' => 'form_id')));
+    $this->assertFalse(isset($values['form_token']), String::format('%element was removed.', array('%element' => 'form_token')));
+    $this->assertFalse(isset($values['form_build_id']), String::format('%element was removed.', array('%element' => 'form_build_id')));
+    $this->assertFalse(isset($values['op']), String::format('%element was removed.', array('%element' => 'op')));
 
     // Verify that all buttons were removed.
-    $this->assertFalse(isset($values['foo']), format_string('%element was removed.', array('%element' => 'foo')));
-    $this->assertFalse(isset($values['bar']), format_string('%element was removed.', array('%element' => 'bar')));
-    $this->assertFalse(isset($values['baz']['foo']), format_string('%element was removed.', array('%element' => 'foo')));
-    $this->assertFalse(isset($values['baz']['baz']), format_string('%element was removed.', array('%element' => 'baz')));
+    $this->assertFalse(isset($values['foo']), String::format('%element was removed.', array('%element' => 'foo')));
+    $this->assertFalse(isset($values['bar']), String::format('%element was removed.', array('%element' => 'bar')));
+    $this->assertFalse(isset($values['baz']['foo']), String::format('%element was removed.', array('%element' => 'foo')));
+    $this->assertFalse(isset($values['baz']['baz']), String::format('%element was removed.', array('%element' => 'baz')));
 
     // Verify that nested form value still exists.
     $this->assertTrue(isset($values['baz']['beer']), 'Nested form value still exists.');
diff --git a/core/modules/system/src/Tests/Form/ValidationTest.php b/core/modules/system/src/Tests/Form/ValidationTest.php
index 7b6c9e8..6993236 100644
--- a/core/modules/system/src/Tests/Form/ValidationTest.php
+++ b/core/modules/system/src/Tests/Form/ValidationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Render\Element;
 use Drupal\simpletest\WebTestBase;
 
@@ -95,7 +96,7 @@ function testValidateLimitErrors() {
         ':id' => 'edit-' . $type,
         ':expected' => $expected,
       ));
-      $this->assertTrue(!empty($element), format_string('The @type button has the proper formnovalidate attribute.', array('@type' => $type)));
+      $this->assertTrue(!empty($element), String::format('The @type button has the proper formnovalidate attribute.', array('@type' => $type)));
     }
     // The button with full server-side validation should not have the
     // 'formnovalidate' attribute.
diff --git a/core/modules/system/src/Tests/Installer/InstallerLanguageTest.php b/core/modules/system/src/Tests/Installer/InstallerLanguageTest.php
index a025b35..b824eb2 100644
--- a/core/modules/system/src/Tests/Installer/InstallerLanguageTest.php
+++ b/core/modules/system/src/Tests/Installer/InstallerLanguageTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Installer;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\KernelTestBase;
 use Drupal\Core\StringTranslation\Translator\FileTranslation;
 
@@ -33,9 +34,9 @@ function testInstallerTranslationFiles() {
     $file_translation = new FileTranslation(drupal_get_path('module', 'simpletest') . '/files/translations');
     foreach ($expected_translation_files as $langcode => $files_expected) {
       $files_found = $file_translation->findTranslationFiles($langcode);
-      $this->assertTrue(count($files_found) == count($files_expected), format_string('@count installer languages found.', array('@count' => count($files_expected))));
+      $this->assertTrue(count($files_found) == count($files_expected), String::format('@count installer languages found.', array('@count' => count($files_expected))));
       foreach ($files_found as $file) {
-        $this->assertTrue(in_array($file->filename, $files_expected), format_string('@file found.', array('@file' => $file->filename)));
+        $this->assertTrue(in_array($file->filename, $files_expected), String::format('@file found.', array('@file' => $file->filename)));
       }
     }
   }
diff --git a/core/modules/system/src/Tests/Menu/LocalTasksTest.php b/core/modules/system/src/Tests/Menu/LocalTasksTest.php
index fc61315..b7d8ef5 100644
--- a/core/modules/system/src/Tests/Menu/LocalTasksTest.php
+++ b/core/modules/system/src/Tests/Menu/LocalTasksTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Menu;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -36,7 +37,7 @@ protected function assertLocalTasks(array $hrefs, $level = 0) {
     foreach ($hrefs as $index => $element) {
       $expected = _url($hrefs[$index]);
       $method = ($elements[$index]['href'] == $expected ? 'pass' : 'fail');
-      $this->{$method}(format_string('Task @number href @value equals @expected.', array(
+      $this->{$method}(String::format('Task @number href @value equals @expected.', array(
         '@number' => $index + 1,
         '@value' => (string) $elements[$index]['href'],
         '@expected' => $expected,
diff --git a/core/modules/system/src/Tests/Menu/MenuTestBase.php b/core/modules/system/src/Tests/Menu/MenuTestBase.php
index 2478af3..a6269ae 100644
--- a/core/modules/system/src/Tests/Menu/MenuTestBase.php
+++ b/core/modules/system/src/Tests/Menu/MenuTestBase.php
@@ -72,7 +72,7 @@ protected function assertBreadcrumbParts($trail) {
     // No parts must be left, or an expected "Home" will always pass.
     $pass = ($pass && empty($parts));
 
-    $this->assertTrue($pass, format_string('Breadcrumb %parts found on @path.', array(
+    $this->assertTrue($pass, String::format('Breadcrumb %parts found on @path.', array(
       '%parts' => implode(' » ', $trail),
       '@path' => $this->getUrl(),
     )));
@@ -125,7 +125,7 @@ protected function assertMenuActiveTrail($tree, $last_active) {
       ':title' => $active_link_title,
     );
     $elements = $this->xpath($xpath, $args);
-    $this->assertTrue(!empty($elements), format_string('Active link %title was found in menu tree, including active trail links %tree.', array(
+    $this->assertTrue(!empty($elements), String::format('Active link %title was found in menu tree, including active trail links %tree.', array(
       '%title' => $active_link_title,
       '%tree' => implode(' » ', $tree),
     )));
diff --git a/core/modules/system/src/Tests/Module/InstallTest.php b/core/modules/system/src/Tests/Module/InstallTest.php
index 476f25d..4e59232 100644
--- a/core/modules/system/src/Tests/Module/InstallTest.php
+++ b/core/modules/system/src/Tests/Module/InstallTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Module;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Extension\ExtensionNameLengthException;
 use Drupal\simpletest\WebTestBase;
 
@@ -60,7 +61,7 @@ public function testRequiredModuleSchemaVersions() {
    */
   public function testModuleNameLength() {
     $module_name = 'invalid_module_name_over_the_maximum_allowed_character_length';
-    $message = format_string('Exception thrown when enabling module %name with a name length over the allowed maximum', array('%name' => $module_name));
+    $message = String::format('Exception thrown when enabling module %name with a name length over the allowed maximum', array('%name' => $module_name));
     try {
       $this->container->get('module_handler')->install(array($module_name));
       $this->fail($message);
@@ -70,7 +71,7 @@ public function testModuleNameLength() {
     }
 
     // Since for the UI, the submit callback uses FALSE, test that too.
-    $message = format_string('Exception thrown when enabling as if via the UI the module %name with a name length over the allowed maximum', array('%name' => $module_name));
+    $message = String::format('Exception thrown when enabling as if via the UI the module %name with a name length over the allowed maximum', array('%name' => $module_name));
     try {
       $this->container->get('module_handler')->install(array($module_name), FALSE);
       $this->fail($message);
diff --git a/core/modules/system/src/Tests/Module/ModuleTestBase.php b/core/modules/system/src/Tests/Module/ModuleTestBase.php
index e3476df..f5b0baf 100644
--- a/core/modules/system/src/Tests/Module/ModuleTestBase.php
+++ b/core/modules/system/src/Tests/Module/ModuleTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Module;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Config\InstallStorage;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Config\FileStorage;
@@ -47,9 +48,9 @@ function assertTableCount($base_table, $count = TRUE) {
     $tables = db_find_tables(Database::getConnection()->prefixTables('{' . $base_table . '}') . '%');
 
     if ($count) {
-      return $this->assertTrue($tables, format_string('Tables matching "@base_table" found.', array('@base_table' => $base_table)));
+      return $this->assertTrue($tables, String::format('Tables matching "@base_table" found.', array('@base_table' => $base_table)));
     }
-    return $this->assertFalse($tables, format_string('Tables matching "@base_table" not found.', array('@base_table' => $base_table)));
+    return $this->assertFalse($tables, String::format('Tables matching "@base_table" not found.', array('@base_table' => $base_table)));
   }
 
   /**
@@ -67,7 +68,7 @@ function assertModuleTablesExist($module) {
         $tables_exist = FALSE;
       }
     }
-    return $this->assertTrue($tables_exist, format_string('All database tables defined by the @module module exist.', array('@module' => $module)));
+    return $this->assertTrue($tables_exist, String::format('All database tables defined by the @module module exist.', array('@module' => $module)));
   }
 
   /**
@@ -84,7 +85,7 @@ function assertModuleTablesDoNotExist($module) {
         $tables_exist = TRUE;
       }
     }
-    return $this->assertFalse($tables_exist, format_string('None of the database tables defined by the @module module exist.', array('@module' => $module)));
+    return $this->assertFalse($tables_exist, String::format('None of the database tables defined by the @module module exist.', array('@module' => $module)));
   }
 
   /**
@@ -126,7 +127,7 @@ function assertModuleConfig($module) {
     }
     // Verify that all configuration has been installed (which means that $names
     // is empty).
-    return $this->assertFalse($names, format_string('All default configuration of @module module found.', array('@module' => $module)));
+    return $this->assertFalse($names, String::format('All default configuration of @module module found.', array('@module' => $module)));
   }
 
   /**
@@ -140,7 +141,7 @@ function assertModuleConfig($module) {
    */
   function assertNoModuleConfig($module) {
     $names = \Drupal::configFactory()->listAll($module . '.');
-    return $this->assertFalse($names, format_string('No configuration found for @module module.', array('@module' => $module)));
+    return $this->assertFalse($names, String::format('No configuration found for @module module.', array('@module' => $module)));
   }
 
   /**
@@ -160,7 +161,7 @@ function assertModules(array $modules, $enabled) {
       else {
         $message = 'Module "@module" is not enabled.';
       }
-      $this->assertEqual($this->container->get('module_handler')->moduleExists($module), $enabled, format_string($message, array('@module' => $module)));
+      $this->assertEqual($this->container->get('module_handler')->moduleExists($module), $enabled, String::format($message, array('@module' => $module)));
     }
   }
 
@@ -194,6 +195,6 @@ function assertLogMessage($type, $message, $variables = array(), $severity = Rfc
       ->countQuery()
       ->execute()
       ->fetchField();
-    $this->assertTrue($count > 0, format_string('watchdog table contains @count rows for @message', array('@count' => $count, '@message' => format_string($message, $variables))));
+    $this->assertTrue($count > 0, String::format('watchdog table contains @count rows for @message', array('@count' => $count, '@message' => String::format($message, $variables))));
   }
 }
diff --git a/core/modules/system/src/Tests/Module/RequiredTest.php b/core/modules/system/src/Tests/Module/RequiredTest.php
index c14d293..b7b04fd 100644
--- a/core/modules/system/src/Tests/Module/RequiredTest.php
+++ b/core/modules/system/src/Tests/Module/RequiredTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\system\Tests\Module;
+use Drupal\Component\Utility\String;
 
 /**
  * Attempt disabling of required modules.
@@ -25,7 +26,7 @@ function testDisableRequired() {
       if (!empty($info['required'])) {
         $field_name = "modules[{$info['package']}][$module][enable]";
         if (empty($info['hidden'])) {
-          $this->assertFieldByXPath("//input[@name='$field_name' and @disabled='disabled' and @checked='checked']", '', format_string('Field @name was disabled and checked.', array('@name' => $field_name)));
+          $this->assertFieldByXPath("//input[@name='$field_name' and @disabled='disabled' and @checked='checked']", '', String::format('Field @name was disabled and checked.', array('@name' => $field_name)));
         }
         else {
           $this->assertNoFieldByName($field_name);
diff --git a/core/modules/system/src/Tests/Path/AliasTest.php b/core/modules/system/src/Tests/Path/AliasTest.php
index f1f6bf2..1ece840 100644
--- a/core/modules/system/src/Tests/Path/AliasTest.php
+++ b/core/modules/system/src/Tests/Path/AliasTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Path;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Cache\MemoryCounterBackend;
 use Drupal\Core\Path\AliasStorage;
 use Drupal\Core\Database\Database;
@@ -37,7 +38,7 @@ function testCRUD() {
       $result = $connection->query('SELECT * FROM {url_alias} WHERE source = :source AND alias= :alias AND langcode = :langcode', array(':source' => $alias['source'], ':alias' => $alias['alias'], ':langcode' => $alias['langcode']));
       $rows = $result->fetchAll();
 
-      $this->assertEqual(count($rows), 1, format_string('Created an entry for %alias.', array('%alias' => $alias['alias'])));
+      $this->assertEqual(count($rows), 1, String::format('Created an entry for %alias.', array('%alias' => $alias['alias'])));
 
       //Cache the pid for further tests.
       $aliases[$idx]['pid'] = $rows[0]->pid;
@@ -47,12 +48,12 @@ function testCRUD() {
     foreach ($aliases as $alias) {
       $pid = $alias['pid'];
       $loadedAlias = $aliasStorage->load(array('pid' => $pid));
-      $this->assertEqual($loadedAlias, $alias, format_string('Loaded the expected path with pid %pid.', array('%pid' => $pid)));
+      $this->assertEqual($loadedAlias, $alias, String::format('Loaded the expected path with pid %pid.', array('%pid' => $pid)));
     }
 
     // Load alias by source path.
     $loadedAlias = $aliasStorage->load(array('source' => 'node/1'));
-    $this->assertEqual($loadedAlias['alias'], 'alias_for_node_1_und', format_string('The last created alias loaded by default.'));
+    $this->assertEqual($loadedAlias['alias'], 'alias_for_node_1_und', String::format('The last created alias loaded by default.'));
 
     //Update a few aliases
     foreach ($aliases as $alias) {
@@ -63,7 +64,7 @@ function testCRUD() {
       $result = $connection->query('SELECT pid FROM {url_alias} WHERE source = :source AND alias= :alias AND langcode = :langcode', array(':source' => $alias['source'], ':alias' => $alias['alias'] . '_updated', ':langcode' => $alias['langcode']));
       $pid = $result->fetchField();
 
-      $this->assertEqual($pid, $alias['pid'], format_string('Updated entry for pid %pid.', array('%pid' => $pid)));
+      $this->assertEqual($pid, $alias['pid'], String::format('Updated entry for pid %pid.', array('%pid' => $pid)));
     }
 
     //Delete a few aliases
@@ -74,7 +75,7 @@ function testCRUD() {
       $result = $connection->query('SELECT * FROM {url_alias} WHERE pid = :pid', array(':pid' => $pid));
       $rows = $result->fetchAll();
 
-      $this->assertEqual(count($rows), 0, format_string('Deleted entry with pid %pid.', array('%pid' => $pid)));
+      $this->assertEqual(count($rows), 0, String::format('Deleted entry with pid %pid.', array('%pid' => $pid)));
     }
   }
 
diff --git a/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php b/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php
index 7f64ddb..9ef55ee 100644
--- a/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php
+++ b/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Path;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -98,7 +99,7 @@ protected function assertUrlOutboundAlter($original, $final) {
     $result = $this->container->get('url_generator')->generateFromPath($original);
     $base_path = base_path() . $GLOBALS['script_path'];
     $result = substr($result, strlen($base_path));
-    $this->assertIdentical($result, $final, format_string('Altered outbound URL %original, expected %final, and got %result.', array('%original' => $original, '%final' => $final, '%result' => $result)));
+    $this->assertIdentical($result, $final, String::format('Altered outbound URL %original, expected %final, and got %result.', array('%original' => $original, '%final' => $final, '%result' => $result)));
   }
 
   /**
@@ -114,6 +115,6 @@ protected function assertUrlOutboundAlter($original, $final) {
   protected function assertUrlInboundAlter($original, $final) {
     // Test inbound altering.
     $result = $this->container->get('path.alias_manager')->getPathByAlias($original);
-    $this->assertIdentical($result, $final, format_string('Altered inbound URL %original, expected %final, and got %result.', array('%original' => $original, '%final' => $final, '%result' => $result)));
+    $this->assertIdentical($result, $final, String::format('Altered inbound URL %original, expected %final, and got %result.', array('%original' => $original, '%final' => $final, '%result' => $result)));
   }
 }
diff --git a/core/modules/system/src/Tests/Session/SessionTest.php b/core/modules/system/src/Tests/Session/SessionTest.php
index ae7fa8d..31292b5 100644
--- a/core/modules/system/src/Tests/Session/SessionTest.php
+++ b/core/modules/system/src/Tests/Session/SessionTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Session;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -63,7 +64,7 @@ function testSessionSaveRegenerate() {
     );
     $this->drupalPostForm('user/login', $edit, t('Log in'));
     $this->drupalGet('user');
-    $pass = $this->assertText($user->getUsername(), format_string('Found name: %name', array('%name' => $user->getUsername())), 'User login');
+    $pass = $this->assertText($user->getUsername(), String::format('Found name: %name', array('%name' => $user->getUsername())), 'User login');
     $this->_logged_in = $pass;
 
     $this->drupalGet('session-test/id');
diff --git a/core/modules/system/src/Tests/System/ErrorHandlerTest.php b/core/modules/system/src/Tests/System/ErrorHandlerTest.php
index 69f1760..be24280 100644
--- a/core/modules/system/src/Tests/System/ErrorHandlerTest.php
+++ b/core/modules/system/src/Tests/System/ErrorHandlerTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\System;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -114,10 +115,10 @@ function testExceptionHandler() {
     $this->assertTrue(strpos($this->drupalGetHeader(':status'), '500 Service unavailable (with message)'), 'Received expected HTTP status line.');
     // We cannot use assertErrorMessage() since the extact error reported
     // varies from database to database. Check that the SQL string is displayed.
-    $this->assertText($error_pdo_exception['%type'], format_string('Found %type in error page.', $error_pdo_exception));
-    $this->assertText($error_pdo_exception['!message'], format_string('Found !message in error page.', $error_pdo_exception));
-    $error_details = format_string('in %function (line ', $error_pdo_exception);
-    $this->assertRaw($error_details, format_string("Found '!message' in error page.", array('!message' => $error_details)));
+    $this->assertText($error_pdo_exception['%type'], String::format('Found %type in error page.', $error_pdo_exception));
+    $this->assertText($error_pdo_exception['!message'], String::format('Found !message in error page.', $error_pdo_exception));
+    $error_details = String::format('in %function (line ', $error_pdo_exception);
+    $this->assertRaw($error_details, String::format("Found '!message' in error page.", array('!message' => $error_details)));
 
     // The exceptions are expected. Do not interpret them as a test failure.
     // Not using File API; a potential error must trigger a PHP warning.
@@ -129,7 +130,7 @@ function testExceptionHandler() {
    */
   function assertErrorMessage(array $error) {
     $message = t('%type: !message in %function (line ', $error);
-    $this->assertRaw($message, format_string('Found error message: !message.', array('!message' => $message)));
+    $this->assertRaw($message, String::format('Found error message: !message.', array('!message' => $message)));
   }
 
   /**
@@ -137,6 +138,6 @@ function assertErrorMessage(array $error) {
    */
   function assertNoErrorMessage(array $error) {
     $message = t('%type: !message in %function (line ', $error);
-    $this->assertNoRaw($message, format_string('Did not find error message: !message.', array('!message' => $message)));
+    $this->assertNoRaw($message, String::format('Did not find error message: !message.', array('!message' => $message)));
   }
 }
diff --git a/core/modules/system/src/Tests/System/SystemConfigFormTestBase.php b/core/modules/system/src/Tests/System/SystemConfigFormTestBase.php
index a9f17c0..b593481 100644
--- a/core/modules/system/src/Tests/System/SystemConfigFormTestBase.php
+++ b/core/modules/system/src/Tests/System/SystemConfigFormTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\System;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Form\FormState;
 use Drupal\simpletest\WebTestBase;
 
@@ -62,7 +63,7 @@ public function testConfigForm() {
       '%values' => print_r($values, TRUE),
       '%errors' => $valid_form ? t('None') : implode(' ', $errors),
     );
-    $this->assertTrue($valid_form, format_string('Input values: %values<br/>Validation handler errors: %errors', $args));
+    $this->assertTrue($valid_form, String::format('Input values: %values<br/>Validation handler errors: %errors', $args));
 
     foreach ($this->values as $data) {
       $this->assertEqual($data['#value'], \Drupal::config($data['#config_name'])->get($data['#config_key']));
diff --git a/core/modules/system/src/Tests/System/TokenReplaceUnitTest.php b/core/modules/system/src/Tests/System/TokenReplaceUnitTest.php
index c512364..c52713c 100644
--- a/core/modules/system/src/Tests/System/TokenReplaceUnitTest.php
+++ b/core/modules/system/src/Tests/System/TokenReplaceUnitTest.php
@@ -41,7 +41,7 @@ public function testSystemTokenRecognition() {
       $input = $test['prefix'] . '[site:name]' . $test['suffix'];
       $expected = $test['prefix'] . 'Drupal' . $test['suffix'];
       $output = $this->tokenService->replace($input, array(), array('langcode' => $this->interfaceLanguage->getId()));
-      $this->assertTrue($output == $expected, format_string('Token recognized in string %string', array('%string' => $input)));
+      $this->assertTrue($output == $expected, String::format('Token recognized in string %string', array('%string' => $input)));
     }
 
     // Test token replacement when the string contains no tokens.
@@ -107,7 +107,7 @@ public function testSystemSiteTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $this->tokenService->replace($input, array(), array('langcode' => $this->interfaceLanguage->getId()));
-      $this->assertEqual($output, $expected, format_string('Sanitized system site information token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Sanitized system site information token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test unsanitized tokens.
@@ -116,7 +116,7 @@ public function testSystemSiteTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $this->tokenService->replace($input, array(), array('langcode' => $this->interfaceLanguage->getId(), 'sanitize' => FALSE));
-      $this->assertEqual($output, $expected, format_string('Unsanitized system site information token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Unsanitized system site information token %token replaced.', array('%token' => $input)));
     }
 
     // Check that the results of Token::generate are sanitized properly. This
@@ -153,7 +153,7 @@ public function testSystemDateTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $this->tokenService->replace($input, array('date' => $date), array('langcode' => $this->interfaceLanguage->getId()));
-      $this->assertEqual($output, $expected, format_string('Date token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Date token %token replaced.', array('%token' => $input)));
     }
   }
 }
diff --git a/core/modules/system/src/Tests/Theme/ThemeTest.php b/core/modules/system/src/Tests/Theme/ThemeTest.php
index bee40f1..59db465 100644
--- a/core/modules/system/src/Tests/Theme/ThemeTest.php
+++ b/core/modules/system/src/Tests/Theme/ThemeTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Tests\Theme;
 
 use Drupal\Component\Serialization\Json;
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 use Drupal\test_theme\ThemeClass;
 
@@ -61,7 +62,7 @@ function testThemeDataTypes() {
     $foos = array('null' => NULL, 'false' => FALSE, 'integer' => 1, 'string' => 'foo');
     foreach ($foos as $type => $example) {
       $output = \Drupal::theme()->render('theme_test_foo', array('foo' => $example));
-      $this->assertTrue(is_string($output), format_string('\Drupal::theme() returns a string for data type !type.', array('!type' => $type)));
+      $this->assertTrue(is_string($output), String::format('\Drupal::theme() returns a string for data type !type.', array('!type' => $type)));
     }
 
     // suggestionnotimplemented is not an implemented theme hook so \Drupal::theme() service
diff --git a/core/modules/system/src/Tests/Transliteration/TransliterationTest.php b/core/modules/system/src/Tests/Transliteration/TransliterationTest.php
index 5c9add1..8ff79d4 100644
--- a/core/modules/system/src/Tests/Transliteration/TransliterationTest.php
+++ b/core/modules/system/src/Tests/Transliteration/TransliterationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Transliteration;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Transliteration\PHPTransliteration;
 use Drupal\simpletest\DrupalUnitTestBase;
 
@@ -85,7 +86,7 @@ public function testPHPTransliteration() {
       $printable = (isset($case[3])) ? $case[3] : $original;
       $transliterator_class = new PHPTransliteration();
       $actual = $transliterator_class->transliterate($original, $langcode);
-      $this->assertIdentical($actual, $expected, format_string('@original transliteration to @actual is identical to @expected for language @langcode in new class instance.', array(
+      $this->assertIdentical($actual, $expected, String::format('@original transliteration to @actual is identical to @expected for language @langcode in new class instance.', array(
         '@original' => $printable,
         '@langcode' => $langcode,
         '@expected' => $expected,
@@ -93,7 +94,7 @@ public function testPHPTransliteration() {
       )));
 
       $actual = $transliterator_service->transliterate($original, $langcode);
-      $this->assertIdentical($actual, $expected, format_string('@original transliteration to @actual is identical to @expected for language @langcode in service instance.', array(
+      $this->assertIdentical($actual, $expected, String::format('@original transliteration to @actual is identical to @expected for language @langcode in service instance.', array(
         '@original' => $printable,
         '@langcode' => $langcode,
         '@expected' => $expected,
diff --git a/core/modules/system/tests/modules/entity_test/entity_test.module b/core/modules/system/tests/modules/entity_test/entity_test.module
index 12950bc..477b5d9 100644
--- a/core/modules/system/tests/modules/entity_test/entity_test.module
+++ b/core/modules/system/tests/modules/entity_test/entity_test.module
@@ -5,6 +5,7 @@
  * Test module for the entity API providing several entity types for testing.
  */
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\FieldableEntityInterface;
@@ -392,7 +393,7 @@ function entity_test_entity_operation_alter(array &$operations, EntityInterface
   if (in_array($entity->getEntityTypeId(), $valid_entity_type_ids)) {
     if (\Drupal::service('router.route_provider')->getRouteByName("entity.{$entity->getEntityTypeId()}.test_operation")) {
       $operations['test_operation'] = [
-        'title' => format_string('Test Operation: @label', ['@label' => $entity->label()]),
+        'title' => String::format('Test Operation: @label', ['@label' => $entity->label()]),
         'url' => Url::fromRoute("entity.{$entity->getEntityTypeId()}.test_operation", [$entity->getEntityTypeId() => $entity->id()]),
         'weight' => 50,
       ];
diff --git a/core/modules/taxonomy/src/Tests/EfqTest.php b/core/modules/taxonomy/src/Tests/EfqTest.php
index ec184b3..e0f196d 100644
--- a/core/modules/taxonomy/src/Tests/EfqTest.php
+++ b/core/modules/taxonomy/src/Tests/EfqTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\taxonomy\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\Query\QueryFactory;
 
 /**
@@ -55,7 +56,7 @@ function testTaxonomyEfq() {
       ->condition('vid', $vocabulary2->id())
       ->execute();
     sort($result);
-    $this->assertEqual(array_keys($terms2), $result, format_string('Taxonomy terms from the %name vocabulary were retrieved by entity query.', array('%name' => $vocabulary2->name)));
+    $this->assertEqual(array_keys($terms2), $result, String::format('Taxonomy terms from the %name vocabulary were retrieved by entity query.', array('%name' => $vocabulary2->name)));
     $tid = reset($result);
     $ids = (object) array(
       'entity_type' => 'taxonomy_term',
diff --git a/core/modules/taxonomy/src/Tests/LoadMultipleTest.php b/core/modules/taxonomy/src/Tests/LoadMultipleTest.php
index 6765ba5..7f8566a 100644
--- a/core/modules/taxonomy/src/Tests/LoadMultipleTest.php
+++ b/core/modules/taxonomy/src/Tests/LoadMultipleTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\taxonomy\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\taxonomy\Entity\Term;
 
 /**
@@ -39,7 +40,7 @@ function testTaxonomyTermMultipleLoad() {
     // Load the terms from the vocabulary.
     $terms = entity_load_multiple_by_properties('taxonomy_term', array('vid' => $vocabulary->id()));
     $count = count($terms);
-    $this->assertEqual($count, 5, format_string('Correct number of terms were loaded. !count terms.', array('!count' => $count)));
+    $this->assertEqual($count, 5, String::format('Correct number of terms were loaded. !count terms.', array('!count' => $count)));
 
     // Load the same terms again by tid.
     $terms2 = Term::loadMultiple(array_keys($terms));
diff --git a/core/modules/taxonomy/src/Tests/TermTest.php b/core/modules/taxonomy/src/Tests/TermTest.php
index 0900dce..b657613 100644
--- a/core/modules/taxonomy/src/Tests/TermTest.php
+++ b/core/modules/taxonomy/src/Tests/TermTest.php
@@ -263,28 +263,28 @@ function testNodeTermCreationAndDeletion() {
     $this->drupalGet('node/' . $node->id());
 
     foreach ($term_names as $term_name) {
-      $this->assertText($term_name, format_string('The term %name appears on the node page after two terms, %deleted1 and %deleted2, were deleted.', array('%name' => $term_name, '%deleted1' => $term_objects['term1']->getName(), '%deleted2' => $term_objects['term2']->getName())));
+      $this->assertText($term_name, String::format('The term %name appears on the node page after two terms, %deleted1 and %deleted2, were deleted.', array('%name' => $term_name, '%deleted1' => $term_objects['term1']->getName(), '%deleted2' => $term_objects['term2']->getName())));
     }
-    $this->assertNoText($term_objects['term1']->getName(), format_string('The deleted term %name does not appear on the node page.', array('%name' => $term_objects['term1']->getName())));
-    $this->assertNoText($term_objects['term2']->getName(), format_string('The deleted term %name does not appear on the node page.', array('%name' => $term_objects['term2']->getName())));
+    $this->assertNoText($term_objects['term1']->getName(), String::format('The deleted term %name does not appear on the node page.', array('%name' => $term_objects['term1']->getName())));
+    $this->assertNoText($term_objects['term2']->getName(), String::format('The deleted term %name does not appear on the node page.', array('%name' => $term_objects['term2']->getName())));
 
     // Test autocomplete on term 3, which contains a comma.
     // The term will be quoted, and the " will be encoded in unicode (\u0022).
     $input = substr($term_objects['term3']->getName(), 0, 3);
     $json = $this->drupalGet('taxonomy/autocomplete/node/taxonomy_' . $this->vocabulary->id(), array('query' => array('q' => $input)));
-    $this->assertEqual($json, '[{"value":"\u0022' . $term_objects['term3']->getName() . '\u0022","label":"' . $term_objects['term3']->getName() . '"}]', format_string('Autocomplete returns term %term_name after typing the first 3 letters.', array('%term_name' => $term_objects['term3']->getName())));
+    $this->assertEqual($json, '[{"value":"\u0022' . $term_objects['term3']->getName() . '\u0022","label":"' . $term_objects['term3']->getName() . '"}]', String::format('Autocomplete returns term %term_name after typing the first 3 letters.', array('%term_name' => $term_objects['term3']->getName())));
 
     // Test autocomplete on term 4 - it is alphanumeric only, so no extra
     // quoting.
     $input = substr($term_objects['term4']->getName(), 0, 3);
     $this->drupalGet('taxonomy/autocomplete/node/taxonomy_' . $this->vocabulary->id(), array('query' => array('q' => $input)));
-    $this->assertRaw('[{"value":"' . $term_objects['term4']->getName() . '","label":"' . $term_objects['term4']->getName() . '"}', format_string('Autocomplete returns term %term_name after typing the first 3 letters.', array('%term_name' => $term_objects['term4']->getName())));
+    $this->assertRaw('[{"value":"' . $term_objects['term4']->getName() . '","label":"' . $term_objects['term4']->getName() . '"}', String::format('Autocomplete returns term %term_name after typing the first 3 letters.', array('%term_name' => $term_objects['term4']->getName())));
 
     // Test taxonomy autocomplete with a nonexistent field.
     $field_name = $this->randomMachineName();
     $tag = $this->randomMachineName();
     $message = t("Taxonomy field @field_name not found.", array('@field_name' => $field_name));
-    $this->assertFalse(FieldStorageConfig::loadByName('node', $field_name), format_string('Field %field_name does not exist.', array('%field_name' => $field_name)));
+    $this->assertFalse(FieldStorageConfig::loadByName('node', $field_name), String::format('Field %field_name does not exist.', array('%field_name' => $field_name)));
     $this->drupalGet('taxonomy/autocomplete/node/' . $field_name, array('query' => array('q' => $tag)));
     $this->assertRaw($message, 'Autocomplete returns correct error message when the taxonomy field does not exist.');
   }
diff --git a/core/modules/taxonomy/src/Tests/TermValidationTest.php b/core/modules/taxonomy/src/Tests/TermValidationTest.php
index b369737..1435773 100644
--- a/core/modules/taxonomy/src/Tests/TermValidationTest.php
+++ b/core/modules/taxonomy/src/Tests/TermValidationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\taxonomy\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\system\Tests\Entity\EntityUnitTestBase;
 
 /**
@@ -63,7 +64,7 @@ public function testValidation() {
     $term->set('parent', 9999);
     $violations = $term->validate();
     $this->assertEqual(count($violations), 1, 'Violation found when term parent is invalid.');
-    $this->assertEqual($violations[0]->getMessage(), format_string('The referenced entity (%type: %id) does not exist.', array('%type' => 'taxonomy_term', '%id' => 9999)));
+    $this->assertEqual($violations[0]->getMessage(), String::format('The referenced entity (%type: %id) does not exist.', array('%type' => 'taxonomy_term', '%id' => 9999)));
 
     $term->set('parent', 0);
     $violations = $term->validate();
diff --git a/core/modules/taxonomy/src/Tests/TokenReplaceTest.php b/core/modules/taxonomy/src/Tests/TokenReplaceTest.php
index f25591b..7795033 100644
--- a/core/modules/taxonomy/src/Tests/TokenReplaceTest.php
+++ b/core/modules/taxonomy/src/Tests/TokenReplaceTest.php
@@ -92,7 +92,7 @@ function testTaxonomyTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('term' => $term1), array('langcode' => $language_interface->getId()));
-      $this->assertEqual($output, $expected, format_string('Sanitized taxonomy term token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Sanitized taxonomy term token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test sanitized tokens for term2.
@@ -112,7 +112,7 @@ function testTaxonomyTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('term' => $term2), array('langcode' => $language_interface->getId()));
-      $this->assertEqual($output, $expected, format_string('Sanitized taxonomy term token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Sanitized taxonomy term token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test unsanitized tokens.
@@ -123,7 +123,7 @@ function testTaxonomyTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('term' => $term2), array('langcode' => $language_interface->getId(), 'sanitize' => FALSE));
-      $this->assertEqual($output, $expected, format_string('Unsanitized taxonomy term token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Unsanitized taxonomy term token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test sanitized tokens.
@@ -139,7 +139,7 @@ function testTaxonomyTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('vocabulary' => $this->vocabulary), array('langcode' => $language_interface->getId()));
-      $this->assertEqual($output, $expected, format_string('Sanitized taxonomy vocabulary token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Sanitized taxonomy vocabulary token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test unsanitized tokens.
@@ -148,7 +148,7 @@ function testTaxonomyTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('vocabulary' => $this->vocabulary), array('langcode' => $language_interface->getId(), 'sanitize' => FALSE));
-      $this->assertEqual($output, $expected, format_string('Unsanitized taxonomy vocabulary token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Unsanitized taxonomy vocabulary token %token replaced.', array('%token' => $input)));
     }
   }
 }
diff --git a/core/modules/text/src/Tests/Formatter/TextFormatterTest.php b/core/modules/text/src/Tests/Formatter/TextFormatterTest.php
index cae892e..bcbfca1 100644
--- a/core/modules/text/src/Tests/Formatter/TextFormatterTest.php
+++ b/core/modules/text/src/Tests/Formatter/TextFormatterTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\text\Tests\Formatter;
 
+use Drupal\Component\Utility\String;
 use Drupal\filter\Entity\FilterFormat;
 use Drupal\system\Tests\Entity\EntityUnitTestBase;
 
@@ -92,7 +93,7 @@ public function testFormatters() {
       $build = $entity->get('formatted_text')->view(array('type' => $formatter));
       drupal_render($build[0]);
       $this->assertEqual($build[0]['#markup'], "<p>Hello, world!</p>\n");
-      $this->assertEqual($build[0]['#cache']['tags'], FilterFormat::load('my_text_format')->getCacheTags(), format_string('The @formatter formatter has the expected cache tags when formatting a formatted text field.', array('@formatter' => $formatter)));
+      $this->assertEqual($build[0]['#cache']['tags'], FilterFormat::load('my_text_format')->getCacheTags(), String::format('The @formatter formatter has the expected cache tags when formatting a formatted text field.', array('@formatter' => $formatter)));
     }
   }
 
diff --git a/core/modules/text/src/Tests/TextFieldTest.php b/core/modules/text/src/Tests/TextFieldTest.php
index 0cb7b3f..461213d 100644
--- a/core/modules/text/src/Tests/TextFieldTest.php
+++ b/core/modules/text/src/Tests/TextFieldTest.php
@@ -114,7 +114,7 @@ function _testTextfieldWidgets($field_type, $widget_type) {
     $this->drupalGet('entity_test/add');
     $this->assertFieldByName("{$field_name}[0][value]", '', 'Widget is displayed');
     $this->assertNoFieldByName("{$field_name}[0][format]", '1', 'Format selector is not displayed');
-    $this->assertRaw(format_string('placeholder="A placeholder on !widget_type"', array('!widget_type' => $widget_type)));
+    $this->assertRaw(String::format('placeholder="A placeholder on !widget_type"', array('!widget_type' => $widget_type)));
 
     // Submit with some value.
     $value = $this->randomMachineName();
diff --git a/core/modules/text/src/Tests/TextSummaryTest.php b/core/modules/text/src/Tests/TextSummaryTest.php
index 27c660f..2874f17 100644
--- a/core/modules/text/src/Tests/TextSummaryTest.php
+++ b/core/modules/text/src/Tests/TextSummaryTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\text\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\DrupalUnitTestBase;
 
 /**
@@ -212,7 +213,7 @@ function testLength() {
    */
   function assertTextSummary($text, $expected, $format = NULL, $size = NULL) {
     $summary = text_summary($text, $format, $size);
-    $this->assertIdentical($summary, $expected, format_string('<pre style="white-space: pre-wrap">@actual</pre> is identical to <pre style="white-space: pre-wrap">@expected</pre>', array(
+    $this->assertIdentical($summary, $expected, String::format('<pre style="white-space: pre-wrap">@actual</pre> is identical to <pre style="white-space: pre-wrap">@expected</pre>', array(
       '@actual' => $summary,
       '@expected' => $expected,
     )));
diff --git a/core/modules/tour/src/Tests/TourTestBase.php b/core/modules/tour/src/Tests/TourTestBase.php
index c6372cd..8c10614 100644
--- a/core/modules/tour/src/Tests/TourTestBase.php
+++ b/core/modules/tour/src/Tests/TourTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\tour\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -56,11 +57,11 @@ public function assertTourTips($tips = array()) {
       foreach ($tips as $tip) {
         if (!empty($tip['data-id'])) {
           $elements = \PHPUnit_Util_XML::cssSelect('#' . $tip['data-id'], TRUE, $this->content, TRUE);
-          $this->assertTrue(!empty($elements) && count($elements) === 1, format_string('Found corresponding page element for tour tip with id #%data-id', array('%data-id' => $tip['data-id'])));
+          $this->assertTrue(!empty($elements) && count($elements) === 1, String::format('Found corresponding page element for tour tip with id #%data-id', array('%data-id' => $tip['data-id'])));
         }
         else if (!empty($tip['data-class'])) {
           $elements = \PHPUnit_Util_XML::cssSelect('.' . $tip['data-class'], TRUE, $this->content, TRUE);
-          $this->assertFalse(empty($elements), format_string('Found corresponding page element for tour tip with class .%data-class', array('%data-class' => $tip['data-class'])));
+          $this->assertFalse(empty($elements), String::format('Found corresponding page element for tour tip with class .%data-class', array('%data-class' => $tip['data-class'])));
         }
         else {
           // It's a modal.
@@ -68,7 +69,7 @@ public function assertTourTips($tips = array()) {
         }
         $total++;
       }
-      $this->pass(format_string('Total %total Tips tested of which %modals modal(s).', array('%total' => $total, '%modals' => $modals)));
+      $this->pass(String::format('Total %total Tips tested of which %modals modal(s).', array('%total' => $total, '%modals' => $modals)));
     }
   }
 
diff --git a/core/modules/tracker/src/Tests/TrackerTest.php b/core/modules/tracker/src/Tests/TrackerTest.php
index d1896fb..02e0467 100644
--- a/core/modules/tracker/src/Tests/TrackerTest.php
+++ b/core/modules/tracker/src/Tests/TrackerTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\tracker\Tests;
 
 use Drupal\comment\CommentInterface;
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -321,7 +322,7 @@ function testTrackerCronIndexing() {
 
     // Assert that all node titles are displayed.
     foreach ($nodes as $i => $node) {
-      $this->assertText($node->label(), format_string('Node @i is displayed on the tracker listing pages.', array('@i' => $i)));
+      $this->assertText($node->label(), String::format('Node @i is displayed on the tracker listing pages.', array('@i' => $i)));
     }
     $this->assertText('1 new', 'One new comment is counted on the tracker listing pages.');
     $this->assertText('updated', 'Node is listed as updated');
@@ -331,7 +332,7 @@ function testTrackerCronIndexing() {
 
     // Assert that all node titles are displayed.
     foreach ($nodes as $i => $node) {
-      $this->assertText($node->label(), format_string('Node @i is displayed on the tracker listing pages.', array('@i' => $i)));
+      $this->assertText($node->label(), String::format('Node @i is displayed on the tracker listing pages.', array('@i' => $i)));
     }
     $this->assertText('1 new', 'New comment is counted on the tracker listing pages.');
   }
diff --git a/core/modules/user/src/Tests/UserDeleteTest.php b/core/modules/user/src/Tests/UserDeleteTest.php
index 747039e..466ca7c 100644
--- a/core/modules/user/src/Tests/UserDeleteTest.php
+++ b/core/modules/user/src/Tests/UserDeleteTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -51,8 +52,8 @@ function testUserDeleteMultiple() {
       ->fetchField();
     $this->assertTrue($roles_after_deletion == 0, 'Role assigments deleted along with users');
     // Test if the users are deleted, user_load() will return FALSE.
-    $this->assertFalse(user_load($user_a->id()), format_string('User with id @uid deleted.', array('@uid' => $user_a->id())));
-    $this->assertFalse(user_load($user_b->id()), format_string('User with id @uid deleted.', array('@uid' => $user_b->id())));
-    $this->assertFalse(user_load($user_c->id()), format_string('User with id @uid deleted.', array('@uid' => $user_c->id())));
+    $this->assertFalse(user_load($user_a->id()), String::format('User with id @uid deleted.', array('@uid' => $user_a->id())));
+    $this->assertFalse(user_load($user_b->id()), String::format('User with id @uid deleted.', array('@uid' => $user_b->id())));
+    $this->assertFalse(user_load($user_c->id()), String::format('User with id @uid deleted.', array('@uid' => $user_c->id())));
   }
 }
diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php
index a1f189d..8209ab0 100644
--- a/core/modules/user/src/Tests/UserRegistrationTest.php
+++ b/core/modules/user/src/Tests/UserRegistrationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\simpletest\WebTestBase;
 
@@ -272,9 +273,9 @@ function testRegistrationWithUserFields() {
       // Check user fields.
       $accounts = entity_load_multiple_by_properties('user', array('name' => $name, 'mail' => $mail));
       $new_user = reset($accounts);
-      $this->assertEqual($new_user->test_user_field[0]->value, $value, format_string('@js : The field value was correclty saved.', array('@js' => $js)));
-      $this->assertEqual($new_user->test_user_field[1]->value, $value + 1, format_string('@js : The field value was correclty saved.', array('@js' => $js)));
-      $this->assertEqual($new_user->test_user_field[2]->value, $value + 2, format_string('@js : The field value was correclty saved.', array('@js' => $js)));
+      $this->assertEqual($new_user->test_user_field[0]->value, $value, String::format('@js : The field value was correclty saved.', array('@js' => $js)));
+      $this->assertEqual($new_user->test_user_field[1]->value, $value + 1, String::format('@js : The field value was correclty saved.', array('@js' => $js)));
+      $this->assertEqual($new_user->test_user_field[2]->value, $value + 2, String::format('@js : The field value was correclty saved.', array('@js' => $js)));
     }
   }
 
diff --git a/core/modules/user/src/Tests/UserTokenReplaceTest.php b/core/modules/user/src/Tests/UserTokenReplaceTest.php
index 897e2aa..0bdf72d 100644
--- a/core/modules/user/src/Tests/UserTokenReplaceTest.php
+++ b/core/modules/user/src/Tests/UserTokenReplaceTest.php
@@ -70,7 +70,7 @@ function testUserTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('user' => $account), array('langcode' => $language_interface->getId()));
-      $this->assertEqual($output, $expected, format_string('Sanitized user token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Sanitized user token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test unsanitized tokens.
@@ -80,7 +80,7 @@ function testUserTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('user' => $account), array('langcode' => $language_interface->getId(), 'sanitize' => FALSE));
-      $this->assertEqual($output, $expected, format_string('Unsanitized user token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, String::format('Unsanitized user token %token replaced.', array('%token' => $input)));
     }
 
     // Generate login and cancel link.
diff --git a/core/modules/views/src/Plugin/views/query/Sql.php b/core/modules/views/src/Plugin/views/query/Sql.php
index 48856cf..80f132a 100644
--- a/core/modules/views/src/Plugin/views/query/Sql.php
+++ b/core/modules/views/src/Plugin/views/query/Sql.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Plugin\views\query;
 
 use Drupal\Component\Utility\NestedArray;
+use Drupal\Component\Utility\String;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -1439,7 +1440,7 @@ function execute(ViewExecutable $view) {
           drupal_set_message($e->getMessage(), 'error');
         }
         else {
-          throw new DatabaseExceptionWrapper(format_string('Exception in @label[@view_name]: @message', array('@label' => $view->storage->label(), '@view_name' => $view->storage->id(), '@message' => $e->getMessage())));
+          throw new DatabaseExceptionWrapper(String::format('Exception in @label[@view_name]: @message', array('@label' => $view->storage->label(), '@view_name' => $view->storage->id(), '@message' => $e->getMessage())));
         }
       }
 
diff --git a/core/modules/views/src/Tests/DefaultViewsTest.php b/core/modules/views/src/Tests/DefaultViewsTest.php
index 15b49a4..21e5680 100644
--- a/core/modules/views/src/Tests/DefaultViewsTest.php
+++ b/core/modules/views/src/Tests/DefaultViewsTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Tests;
 
 use Drupal\comment\CommentInterface;
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Url;
@@ -135,14 +136,14 @@ public function testDefaultViews() {
           $view->preExecute($this->viewArgMap[$name]);
         }
 
-        $this->assert(TRUE, format_string('View @view will be executed.', array('@view' => $view->storage->id())));
+        $this->assert(TRUE, String::format('View @view will be executed.', array('@view' => $view->storage->id())));
         $view->execute();
 
         $tokens = array('@name' => $name, '@display_id' => $display_id);
-        $this->assertTrue($view->executed, format_string('@name:@display_id has been executed.', $tokens));
+        $this->assertTrue($view->executed, String::format('@name:@display_id has been executed.', $tokens));
 
         $count = count($view->result);
-        $this->assertTrue($count > 0, format_string('@count results returned', array('@count' => $count)));
+        $this->assertTrue($count > 0, String::format('@count results returned', array('@count' => $count)));
         $view->destroy();
       }
     }
diff --git a/core/modules/views/src/Tests/Handler/AreaEntityTest.php b/core/modules/views/src/Tests/Handler/AreaEntityTest.php
index af44b44..12687a1 100644
--- a/core/modules/views/src/Tests/Handler/AreaEntityTest.php
+++ b/core/modules/views/src/Tests/Handler/AreaEntityTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests\Handler;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Form\FormState;
 use Drupal\views\Tests\ViewTestBase;
@@ -53,9 +54,9 @@ public function testEntityAreaData() {
 
     // Test that all expected entity types have data.
     foreach (array_keys($expected_entities) as $entity) {
-      $this->assertTrue(!empty($data['entity_' . $entity]), format_string('Views entity area data found for @entity', array('@entity' => $entity)));
+      $this->assertTrue(!empty($data['entity_' . $entity]), String::format('Views entity area data found for @entity', array('@entity' => $entity)));
       // Test that entity_type is set correctly in the area data.
-      $this->assertEqual($entity, $data['entity_' . $entity]['area']['entity_type'], format_string('Correct entity_type set for @entity', array('@entity' => $entity)));
+      $this->assertEqual($entity, $data['entity_' . $entity]['area']['entity_type'], String::format('Correct entity_type set for @entity', array('@entity' => $entity)));
     }
 
     $expected_entities = array_filter($entity_types, function (EntityTypeInterface $type) {
@@ -64,7 +65,7 @@ public function testEntityAreaData() {
 
     // Test that no configuration entity types have data.
     foreach (array_keys($expected_entities) as $entity) {
-      $this->assertTrue(empty($data['entity_' . $entity]), format_string('Views config entity area data not found for @entity', array('@entity' => $entity)));
+      $this->assertTrue(empty($data['entity_' . $entity]), String::format('Views config entity area data not found for @entity', array('@entity' => $entity)));
     }
   }
 
diff --git a/core/modules/views/src/Tests/Handler/FieldCounterTest.php b/core/modules/views/src/Tests/Handler/FieldCounterTest.php
index 1290e67..80db88e 100644
--- a/core/modules/views/src/Tests/Handler/FieldCounterTest.php
+++ b/core/modules/views/src/Tests/Handler/FieldCounterTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests\Handler;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Tests\ViewUnitTestBase;
 use Drupal\views\Views;
 
@@ -51,11 +52,11 @@ function testSimple() {
     $view->preview();
 
     $counter = $view->style_plugin->getField(0, 'counter');
-    $this->assertEqual($counter, 1, format_string('Make sure the expected number (@expected) patches with the rendered number (@counter)', array('@expected' => 1, '@counter' => $counter)));
+    $this->assertEqual($counter, 1, String::format('Make sure the expected number (@expected) patches with the rendered number (@counter)', array('@expected' => 1, '@counter' => $counter)));
     $counter = $view->style_plugin->getField(1, 'counter');
-    $this->assertEqual($counter, 2, format_string('Make sure the expected number (@expected) patches with the rendered number (@counter)', array('@expected' => 2, '@counter' => $counter)));
+    $this->assertEqual($counter, 2, String::format('Make sure the expected number (@expected) patches with the rendered number (@counter)', array('@expected' => 2, '@counter' => $counter)));
     $counter = $view->style_plugin->getField(2, 'counter');
-    $this->assertEqual($counter, 3, format_string('Make sure the expected number (@expected) patches with the rendered number (@counter)', array('@expected' => 3, '@counter' => $counter)));
+    $this->assertEqual($counter, 3, String::format('Make sure the expected number (@expected) patches with the rendered number (@counter)', array('@expected' => 3, '@counter' => $counter)));
     $view->destroy();
 
     $view->setDisplay();
@@ -79,13 +80,13 @@ function testSimple() {
 
     $counter = $view->style_plugin->getField(0, 'counter');
     $expected_number = 0 + $rand_start;
-    $this->assertEqual($counter, $expected_number, format_string('Make sure the expected number (@expected) patches with the rendered number (@counter)', array('@expected' => $expected_number, '@counter' => $counter)));
+    $this->assertEqual($counter, $expected_number, String::format('Make sure the expected number (@expected) patches with the rendered number (@counter)', array('@expected' => $expected_number, '@counter' => $counter)));
     $counter = $view->style_plugin->getField(1, 'counter');
     $expected_number = 1 + $rand_start;
-    $this->assertEqual($counter, $expected_number, format_string('Make sure the expected number (@expected) patches with the rendered number (@counter)', array('@expected' => $expected_number, '@counter' => $counter)));
+    $this->assertEqual($counter, $expected_number, String::format('Make sure the expected number (@expected) patches with the rendered number (@counter)', array('@expected' => $expected_number, '@counter' => $counter)));
     $counter = $view->style_plugin->getField(2, 'counter');
     $expected_number = 2 + $rand_start;
-    $this->assertEqual($counter, $expected_number, format_string('Make sure the expected number (@expected) patches with the rendered number (@counter)', array('@expected' => $expected_number, '@counter' => $counter)));
+    $this->assertEqual($counter, $expected_number, String::format('Make sure the expected number (@expected) patches with the rendered number (@counter)', array('@expected' => $expected_number, '@counter' => $counter)));
   }
 
   // @TODO: Write tests for pager.
diff --git a/core/modules/views/src/Tests/Handler/FieldUnitTest.php b/core/modules/views/src/Tests/Handler/FieldUnitTest.php
index 12fe74e..5542e65 100644
--- a/core/modules/views/src/Tests/Handler/FieldUnitTest.php
+++ b/core/modules/views/src/Tests/Handler/FieldUnitTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests\Handler;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Tests\ViewUnitTestBase;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\views\Views;
@@ -93,8 +94,9 @@ public function testQuery() {
    *   The value to search for.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -117,8 +119,9 @@ protected function assertSubString($haystack, $needle, $message = '', $group = '
    *   The value to search for.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use format_string() to embed variables in the message text, not
-   *   t(). If left blank, a default message will be displayed.
+   *   messages: use \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param string $group
    *   (optional) The group this message is in, which is displayed in a column
    *   in test output. Use 'Debug' to indicate this is debugging output. Do not
@@ -194,7 +197,7 @@ public function testFieldTokens() {
     $random_text = $this->randomMachineName();
     $job_field->setTestValue($random_text);
     $output = $job_field->advancedRender($row);
-    $this->assertSubString($output, $random_text, format_string('Make sure the self token (!value) appears in the output (!output)', array('!value' => $random_text, '!output' => $output)));
+    $this->assertSubString($output, $random_text, String::format('Make sure the self token (!value) appears in the output (!output)', array('!value' => $random_text, '!output' => $output)));
   }
 
   /**
diff --git a/core/modules/views/src/Tests/Handler/FieldWebTest.php b/core/modules/views/src/Tests/Handler/FieldWebTest.php
index cd11a52..64e6ecb 100644
--- a/core/modules/views/src/Tests/Handler/FieldWebTest.php
+++ b/core/modules/views/src/Tests/Handler/FieldWebTest.php
@@ -485,12 +485,12 @@ public function testTextRendering() {
     $trimmed_name = Unicode::substr($row->views_test_data_name, 0, 5);
 
     $output = $name_field->advancedRender($row);
-    $this->assertSubString($output, $trimmed_name, format_string('Make sure the trimmed output (!trimmed) appears in the rendered output (!output).', array('!trimmed' => $trimmed_name, '!output' => $output)));
-    $this->assertNotSubString($output, $row->views_test_data_name, format_string("Make sure the untrimmed value (!untrimmed) shouldn't appear in the rendered output (!output).", array('!untrimmed' => $row->views_test_data_name, '!output' => $output)));
+    $this->assertSubString($output, $trimmed_name, String::format('Make sure the trimmed output (!trimmed) appears in the rendered output (!output).', array('!trimmed' => $trimmed_name, '!output' => $output)));
+    $this->assertNotSubString($output, $row->views_test_data_name, String::format("Make sure the untrimmed value (!untrimmed) shouldn't appear in the rendered output (!output).", array('!untrimmed' => $row->views_test_data_name, '!output' => $output)));
 
     $name_field->options['alter']['max_length'] = 9;
     $output = $name_field->advancedRender($row);
-    $this->assertSubString($output, $trimmed_name, format_string('Make sure the untrimmed (!untrimmed) output appears in the rendered output  (!output).', array('!trimmed' => $trimmed_name, '!output' => $output)));
+    $this->assertSubString($output, $trimmed_name, String::format('Make sure the untrimmed (!untrimmed) output appears in the rendered output  (!output).', array('!trimmed' => $trimmed_name, '!output' => $output)));
 
     // Take word_boundary into account for the tests.
     $name_field->options['alter']['max_length'] = 5;
@@ -532,10 +532,10 @@ public function testTextRendering() {
       $output = $name_field->advancedRender($row);
 
       if ($touple['trimmed']) {
-        $this->assertNotSubString($output, $touple['value'], format_string('The untrimmed value (!untrimmed) should not appear in the trimmed output (!output).', array('!untrimmed' => $touple['value'], '!output' => $output)));
+        $this->assertNotSubString($output, $touple['value'], String::format('The untrimmed value (!untrimmed) should not appear in the trimmed output (!output).', array('!untrimmed' => $touple['value'], '!output' => $output)));
       }
       if (!empty($touble['trimmed_value'])) {
-        $this->assertSubString($output, $touple['trimmed_value'], format_string('The trimmed value (!trimmed) should appear in the trimmed output (!output).', array('!trimmed' => $touple['trimmed_value'], '!output' => $output)));
+        $this->assertSubString($output, $touple['trimmed_value'], String::format('The trimmed value (!trimmed) should appear in the trimmed output (!output).', array('!trimmed' => $touple['trimmed_value'], '!output' => $output)));
       }
     }
 
diff --git a/core/modules/views/src/Tests/Handler/HandlerAllTest.php b/core/modules/views/src/Tests/Handler/HandlerAllTest.php
index ba83c54..9a84258 100644
--- a/core/modules/views/src/Tests/Handler/HandlerAllTest.php
+++ b/core/modules/views/src/Tests/Handler/HandlerAllTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests\Handler;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\HandlerBase;
 use Drupal\views\Plugin\views\filter\InOperator;
@@ -96,7 +97,7 @@ public function testHandlers() {
       foreach ($object_types as $type) {
         if (isset($view->{$type})) {
           foreach ($view->{$type} as $handler) {
-            $this->assertTrue($handler instanceof HandlerBase, format_string(
+            $this->assertTrue($handler instanceof HandlerBase, String::format(
               '@type handler of class %class is an instance of HandlerBase',
               array(
                 '@type' => $type,
diff --git a/core/modules/views/src/Tests/ModuleTest.php b/core/modules/views/src/Tests/ModuleTest.php
index 1f52a19..3a6354b 100644
--- a/core/modules/views/src/Tests/ModuleTest.php
+++ b/core/modules/views/src/Tests/ModuleTest.php
@@ -94,7 +94,7 @@ public function testViewsGetHandler() {
       'field' => 'field_invalid',
     );
     $this->container->get('plugin.manager.views.field')->getHandler($item);
-    $this->assertTrue(strpos($this->lastErrorMessage, format_string("Missing handler: @table @field @type", array('@table' => 'views_test_data', '@field' => 'field_invalid', '@type' => 'field'))) !== FALSE, 'An invalid field name throws a debug message.');
+    $this->assertTrue(strpos($this->lastErrorMessage, String::format("Missing handler: @table @field @type", array('@table' => 'views_test_data', '@field' => 'field_invalid', '@type' => 'field'))) !== FALSE, 'An invalid field name throws a debug message.');
     unset($this->lastErrorMessage);
 
     $item = array(
@@ -102,7 +102,7 @@ public function testViewsGetHandler() {
       'field' => 'id',
     );
     $this->container->get('plugin.manager.views.filter')->getHandler($item);
-    $this->assertEqual(strpos($this->lastErrorMessage, format_string("Missing handler: @table @field @type", array('@table' => 'table_invalid', '@field' => 'id', '@type' => 'filter'))) !== FALSE, 'An invalid table name throws a debug message.');
+    $this->assertEqual(strpos($this->lastErrorMessage, String::format("Missing handler: @table @field @type", array('@table' => 'table_invalid', '@field' => 'id', '@type' => 'filter'))) !== FALSE, 'An invalid table name throws a debug message.');
     unset($this->lastErrorMessage);
 
     $item = array(
@@ -110,7 +110,7 @@ public function testViewsGetHandler() {
       'field' => 'id',
     );
     $this->container->get('plugin.manager.views.filter')->getHandler($item);
-    $this->assertEqual(strpos($this->lastErrorMessage, format_string("Missing handler: @table @field @type", array('@table' => 'table_invalid', '@field' => 'id', '@type' => 'filter'))) !== FALSE, 'An invalid table name throws a debug message.');
+    $this->assertEqual(strpos($this->lastErrorMessage, String::format("Missing handler: @table @field @type", array('@table' => 'table_invalid', '@field' => 'id', '@type' => 'filter'))) !== FALSE, 'An invalid table name throws a debug message.');
     unset($this->lastErrorMessage);
 
     restore_error_handler();
diff --git a/core/modules/views/src/Tests/Plugin/FilterTest.php b/core/modules/views/src/Tests/Plugin/FilterTest.php
index 63d90ab..7f877ee 100644
--- a/core/modules/views/src/Tests/Plugin/FilterTest.php
+++ b/core/modules/views/src/Tests/Plugin/FilterTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests\Plugin;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 use Drupal\views_test_data\Plugin\views\filter\FilterTest as FilterPlugin;
 
@@ -89,7 +90,7 @@ public function testFilterQuery() {
     $this->assertIdentical($view->filter['test_filter']->value, 'John');
 
     // Check that we have some results.
-    $this->assertEqual(count($view->result), 1, format_string('Results were returned. @count results.', array('@count' => count($view->result))));
+    $this->assertEqual(count($view->result), 1, String::format('Results were returned. @count results.', array('@count' => count($view->result))));
 
     $view->destroy();
 
@@ -115,7 +116,7 @@ public function testFilterQuery() {
 
     // Test that no nodes have been returned (Only 'page' type nodes should
     // exist).
-    $this->assertEqual(count($view->result), 4, format_string('No results were returned. @count results.', array('@count' => count($view->result))));
+    $this->assertEqual(count($view->result), 4, String::format('No results were returned. @count results.', array('@count' => count($view->result))));
 
     $view->destroy();
     $view->initDisplay();
@@ -139,7 +140,7 @@ public function testFilterQuery() {
     $this->executeView($view);
 
     // Check if we have all 5 results.
-    $this->assertEqual(count($view->result), 5, format_string('All @count results returned', array('@count' => count($view->displayHandlers))));
+    $this->assertEqual(count($view->result), 5, String::format('All @count results returned', array('@count' => count($view->displayHandlers))));
   }
 
 }
diff --git a/core/modules/views/src/Tests/Plugin/StyleMappingTest.php b/core/modules/views/src/Tests/Plugin/StyleMappingTest.php
index 24b06d2..325d100 100644
--- a/core/modules/views/src/Tests/Plugin/StyleMappingTest.php
+++ b/core/modules/views/src/Tests/Plugin/StyleMappingTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests\Plugin;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 
 /**
@@ -73,7 +74,7 @@ protected function mappedOutputHelper($view) {
         // separated by ':'.
         $expected_result = $name . ':' . $data_set[$count][$field_id];
         $actual_result = (string) $field;
-        $this->assertIdentical($expected_result, $actual_result, format_string('The fields were mapped successfully: %name => %field_id', array('%name' => $name, '%field_id' => $field_id)));
+        $this->assertIdentical($expected_result, $actual_result, String::format('The fields were mapped successfully: %name => %field_id', array('%name' => $name, '%field_id' => $field_id)));
       }
 
       $count++;
diff --git a/core/modules/views/src/Tests/PluginInstanceTest.php b/core/modules/views/src/Tests/PluginInstanceTest.php
index 1893432..c40b986 100644
--- a/core/modules/views/src/Tests/PluginInstanceTest.php
+++ b/core/modules/views/src/Tests/PluginInstanceTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 
 /**
@@ -65,8 +66,8 @@ public function testPluginData() {
 
     // Check all plugin types.
     foreach ($this->pluginTypes as $type) {
-      $this->assertTrue(array_key_exists($type, $this->definitions), format_string('Key for plugin type @type found.', array('@type' => $type)));
-      $this->assertTrue(is_array($this->definitions[$type]) && !empty($this->definitions[$type]), format_string('Plugin type @type has an array of plugins.', array('@type' => $type)));
+      $this->assertTrue(array_key_exists($type, $this->definitions), String::format('Key for plugin type @type found.', array('@type' => $type)));
+      $this->assertTrue(is_array($this->definitions[$type]) && !empty($this->definitions[$type]), String::format('Plugin type @type has an array of plugins.', array('@type' => $type)));
     }
 
     // Tests that the plugin list has not missed any types.
@@ -92,7 +93,7 @@ public function testPluginInstances() {
           // good to check they can be created but for throwing any notices for
           // method signatures etc... too.
           $instance = $manager->createInstance($id);
-          $this->assertTrue($instance instanceof $definition['class'], format_string('Instance of @type:@id created', array('@type' => $type, '@id' => $id)));
+          $this->assertTrue($instance instanceof $definition['class'], String::format('Instance of @type:@id created', array('@type' => $type, '@id' => $id)));
         }
       }
     }
diff --git a/core/modules/views/src/Tests/QueryGroupByTest.php b/core/modules/views/src/Tests/QueryGroupByTest.php
index 1ef83ec..646e5d1 100644
--- a/core/modules/views/src/Tests/QueryGroupByTest.php
+++ b/core/modules/views/src/Tests/QueryGroupByTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 
 /**
@@ -93,8 +94,8 @@ public function groupByTestHelper($aggregation_function, $values) {
     foreach ($view->result as $item) {
       $results[$item->entity_test_name] = $item->id;
     }
-    $this->assertEqual($results['name1'], $values[0], format_string('Aggregation with @aggregation_function and groupby name: name1 returned the expected amount of results', array('@aggregation_function' => $aggregation_function)));
-    $this->assertEqual($results['name2'], $values[1], format_string('Aggregation with @aggregation_function and groupby name: name2 returned the expected amount of results', array('@aggregation_function' => $aggregation_function)));
+    $this->assertEqual($results['name1'], $values[0], String::format('Aggregation with @aggregation_function and groupby name: name1 returned the expected amount of results', array('@aggregation_function' => $aggregation_function)));
+    $this->assertEqual($results['name2'], $values[1], String::format('Aggregation with @aggregation_function and groupby name: name2 returned the expected amount of results', array('@aggregation_function' => $aggregation_function)));
   }
 
   /**
diff --git a/core/modules/views/src/Tests/TokenReplaceTest.php b/core/modules/views/src/Tests/TokenReplaceTest.php
index 13ae1cd..65f380d 100644
--- a/core/modules/views/src/Tests/TokenReplaceTest.php
+++ b/core/modules/views/src/Tests/TokenReplaceTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 
 /**
@@ -55,7 +56,7 @@ function testTokenReplacement() {
 
     foreach ($expected as $token => $expected_output) {
       $output = $token_handler->replace($token, array('view' => $view));
-      $this->assertIdentical($output, $expected_output, format_string('Token %token replaced correctly.', array('%token' => $token)));
+      $this->assertIdentical($output, $expected_output, String::format('Token %token replaced correctly.', array('%token' => $token)));
     }
   }
 
diff --git a/core/modules/views/src/Tests/ViewExecutableTest.php b/core/modules/views/src/Tests/ViewExecutableTest.php
index 5b0fe2b..f386301 100644
--- a/core/modules/views/src/Tests/ViewExecutableTest.php
+++ b/core/modules/views/src/Tests/ViewExecutableTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 use Drupal\views\ViewExecutable;
 use Drupal\views\ViewExecutableFactory;
@@ -122,7 +123,7 @@ public function testInitMethods() {
       if ($type == 'relationship') {
         continue;
       }
-      $this->assertTrue(count($view->$type), format_string('Make sure a %type instance got instantiated.', array('%type' => $type)));
+      $this->assertTrue(count($view->$type), String::format('Make sure a %type instance got instantiated.', array('%type' => $type)));
     }
 
     // initHandlers() should create display handlers automatically as well.
@@ -423,7 +424,7 @@ public function testValidate() {
       $match = function($value) use ($display) {
         return strpos($value, $display->display['display_title']) !== false;
       };
-      $this->assertTrue(array_filter($validate[$id], $match), format_string('Error message found for @id display', array('@id' => $id)));
+      $this->assertTrue(array_filter($validate[$id], $match), String::format('Error message found for @id display', array('@id' => $id)));
       $count++;
     }
 
diff --git a/core/modules/views/src/Tests/ViewStorageTest.php b/core/modules/views/src/Tests/ViewStorageTest.php
index 3eeda98..41285e2 100644
--- a/core/modules/views/src/Tests/ViewStorageTest.php
+++ b/core/modules/views/src/Tests/ViewStorageTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Config\Entity\ConfigEntityStorage;
 use Drupal\views\Entity\View;
@@ -93,7 +94,7 @@ protected function loadTests() {
     // expected properties.
     $this->assertTrue($view instanceof View, 'Single View instance loaded.');
     foreach ($this->config_properties as $property) {
-      $this->assertTrue($view->get($property) !== NULL, format_string('Property: @property loaded onto View.', array('@property' => $property)));
+      $this->assertTrue($view->get($property) !== NULL, String::format('Property: @property loaded onto View.', array('@property' => $property)));
     }
 
     // Check the displays have been loaded correctly from config display data.
@@ -109,7 +110,7 @@ protected function loadTests() {
       // exists.
       $original_options = $data['display'][$key];
       foreach ($original_options as $orig_key => $value) {
-        $this->assertIdentical($display[$orig_key], $value, format_string('@key is identical to saved data', array('@key' => $key)));
+        $this->assertIdentical($display[$orig_key], $value, String::format('@key is identical to saved data', array('@key' => $key)));
       }
     }
 
@@ -128,7 +129,7 @@ protected function createTests() {
     $this->assertTrue($created instanceof View, 'Created object is a View.');
     // Check that the View contains all of the properties.
     foreach ($this->config_properties as $property) {
-      $this->assertTrue(property_exists($created, $property), format_string('Property: @property created on View.', array('@property' => $property)));
+      $this->assertTrue(property_exists($created, $property), String::format('Property: @property created on View.', array('@property' => $property)));
     }
 
     // Create a new View instance with config values.
@@ -145,8 +146,8 @@ protected function createTests() {
 
     // Test all properties except displays.
     foreach ($properties as $property) {
-      $this->assertTrue($created->get($property) !== NULL, format_string('Property: @property created on View.', array('@property' => $property)));
-      $this->assertIdentical($values[$property], $created->get($property), format_string('Property value: @property matches configuration value.', array('@property' => $property)));
+      $this->assertTrue($created->get($property) !== NULL, String::format('Property: @property created on View.', array('@property' => $property)));
+      $this->assertIdentical($values[$property], $created->get($property), String::format('Property value: @property matches configuration value.', array('@property' => $property)));
     }
 
     // Check the UUID of the loaded View.
@@ -218,14 +219,14 @@ protected function displayMethodTests() {
     $random_title = $this->randomMachineName();
 
     $id = $view->addDisplay('page', $random_title);
-    $this->assertEqual($id, 'page_1', format_string('Make sure the first display (%id_new) has the expected ID (%id)', array('%id_new' => $id, '%id' => 'page_1')));
+    $this->assertEqual($id, 'page_1', String::format('Make sure the first display (%id_new) has the expected ID (%id)', array('%id_new' => $id, '%id' => 'page_1')));
     $display = $view->get('display');
     $this->assertEqual($display[$id]['display_title'], $random_title);
 
     $random_title = $this->randomMachineName();
     $id = $view->addDisplay('page', $random_title);
     $display = $view->get('display');
-    $this->assertEqual($id, 'page_2', format_string('Make sure the second display (%id_new) has the expected ID (%id)', array('%id_new' => $id, '%id' => 'page_2')));
+    $this->assertEqual($id, 'page_2', String::format('Make sure the second display (%id_new) has the expected ID (%id)', array('%id_new' => $id, '%id' => 'page_2')));
     $this->assertEqual($display[$id]['display_title'], $random_title);
 
     $id = $view->addDisplay('page');
@@ -335,14 +336,14 @@ public function testCreateDuplicate() {
     );
 
     foreach ($config_properties as $property) {
-      $this->assertIdentical($view->storage->get($property), $copy->get($property), format_string('@property property is identical.', array('@property' => $property)));
+      $this->assertIdentical($view->storage->get($property), $copy->get($property), String::format('@property property is identical.', array('@property' => $property)));
     }
 
     // Check the displays are the same.
     $copy_display = $copy->get('display');
     foreach ($view->storage->get('display') as $id => $display) {
       // assertIdentical will not work here.
-      $this->assertEqual($display, $copy_display[$id], format_string('The @display display has been copied correctly.', array('@display' => $id)));
+      $this->assertEqual($display, $copy_display[$id], String::format('The @display display has been copied correctly.', array('@display' => $id)));
     }
   }
 
diff --git a/core/modules/views/src/Tests/ViewUnitTestBase.php b/core/modules/views/src/Tests/ViewUnitTestBase.php
index 0d07484..7b862b0 100644
--- a/core/modules/views/src/Tests/ViewUnitTestBase.php
+++ b/core/modules/views/src/Tests/ViewUnitTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Database\Query\SelectInterface;
 use Drupal\views\ViewExecutable;
 use Drupal\views\ViewsBundle;
@@ -180,7 +181,7 @@ protected function assertIdenticalResultsetHelper($view, $expected_result, $colu
     // Do the actual comparison.
     if (!isset($message)) {
       $not = (strpos($assert_method, 'Not') ? 'not' : '');
-      $message = format_string("Actual result <pre>\n@actual\n</pre> is $not identical to expected <pre>\n@expected\n</pre>", array(
+      $message = String::format("Actual result <pre>\n@actual\n</pre> is $not identical to expected <pre>\n@expected\n</pre>", array(
         '@actual' => var_export($result, TRUE),
         '@expected' => var_export($expected_result, TRUE),
       ));
diff --git a/core/modules/views/src/Tests/ViewsHooksTest.php b/core/modules/views/src/Tests/ViewsHooksTest.php
index 534df07..29b189d 100644
--- a/core/modules/views/src/Tests/ViewsHooksTest.php
+++ b/core/modules/views/src/Tests/ViewsHooksTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 
 /**
@@ -68,7 +69,7 @@ public function testHooks() {
 
     // Test each hook is found in the implementations array and is invoked.
     foreach (static::$hooks as $hook => $type) {
-      $this->assertTrue($this->moduleHandler->implementsHook('views_test_data', $hook), format_string('The hook @hook was registered.', array('@hook' => $hook)));
+      $this->assertTrue($this->moduleHandler->implementsHook('views_test_data', $hook), String::format('The hook @hook was registered.', array('@hook' => $hook)));
 
       switch ($type) {
         case 'view':
@@ -84,7 +85,7 @@ public function testHooks() {
           $this->moduleHandler->invoke('views_test_data', $hook);
       }
 
-      $this->assertTrue($this->container->get('state')->get('views_hook_test_' . $hook), format_string('The %hook hook was invoked.', array('%hook' => $hook)));
+      $this->assertTrue($this->container->get('state')->get('views_hook_test_' . $hook), String::format('The %hook hook was invoked.', array('%hook' => $hook)));
       // Reset the module implementations cache, so we ensure that the
       // .views.inc file is loaded actively.
       $this->moduleHandler->resetImplementations();
diff --git a/core/modules/views/src/ViewExecutable.php b/core/modules/views/src/ViewExecutable.php
index 9214808..50da011 100644
--- a/core/modules/views/src/ViewExecutable.php
+++ b/core/modules/views/src/ViewExecutable.php
@@ -685,7 +685,7 @@ public function setDisplay($display_id = NULL) {
 
     // Ensure the requested display exists.
     if (!$this->displayHandlers->has($display_id)) {
-      debug(format_string('setDisplay() called with invalid display ID "@display".', array('@display' => $display_id)));
+      debug(String::format('setDisplay() called with invalid display ID "@display".', array('@display' => $display_id)));
       return FALSE;
     }
 
diff --git a/core/modules/views_ui/src/Tests/AnalyzeTest.php b/core/modules/views_ui/src/Tests/AnalyzeTest.php
index 0d82239..4561af4 100644
--- a/core/modules/views_ui/src/Tests/AnalyzeTest.php
+++ b/core/modules/views_ui/src/Tests/AnalyzeTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Tests\ViewTestBase;
 
 /**
@@ -54,7 +55,7 @@ function testAnalyzeBasic() {
 
     foreach (array('ok', 'warning', 'error') as $type) {
       $xpath = $this->xpath('//div[contains(@class, :class)]', array(':class' => $type));
-      $this->assertTrue(count($xpath), format_string('Analyse messages with @type found', array('@type' => $type)));
+      $this->assertTrue(count($xpath), String::format('Analyse messages with @type found', array('@type' => $type)));
     }
 
     // This redirects the user back to the main views edit page.
diff --git a/core/modules/views_ui/src/Tests/CustomBooleanTest.php b/core/modules/views_ui/src/Tests/CustomBooleanTest.php
index ebf989b..7b2d925 100644
--- a/core/modules/views_ui/src/Tests/CustomBooleanTest.php
+++ b/core/modules/views_ui/src/Tests/CustomBooleanTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 
 /**
@@ -101,8 +102,8 @@ public function testCustomOption() {
       $output = drupal_render($output);
 
       $replacements = array('%type' => $type);
-      $this->{$values['test']}(strpos($output, $values['true']), format_string('Expected custom boolean TRUE value in output for %type.', $replacements));
-      $this->{$values['test']}(strpos($output, $values['false']), format_string('Expected custom boolean FALSE value in output for %type', $replacements));
+      $this->{$values['test']}(strpos($output, $values['true']), String::format('Expected custom boolean TRUE value in output for %type.', $replacements));
+      $this->{$values['test']}(strpos($output, $values['false']), String::format('Expected custom boolean FALSE value in output for %type', $replacements));
     }
   }
 
diff --git a/core/modules/views_ui/src/Tests/DefaultViewsTest.php b/core/modules/views_ui/src/Tests/DefaultViewsTest.php
index 080d774..45df15f 100644
--- a/core/modules/views_ui/src/Tests/DefaultViewsTest.php
+++ b/core/modules/views_ui/src/Tests/DefaultViewsTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\views_ui\Tests;
+use Drupal\Component\Utility\String;
 
 /**
  * Tests enabling, disabling, and reverting default views via the listing page.
@@ -199,7 +200,7 @@ function clickViewsOperationLink($label, $unique_href_part) {
         break;
       }
     }
-    $this->assertTrue(isset($index), format_string('Link to "@label" containing @part found.', array('@label' => $label, '@part' => $unique_href_part)));
+    $this->assertTrue(isset($index), String::format('Link to "@label" containing @part found.', array('@label' => $label, '@part' => $unique_href_part)));
     if (isset($index)) {
       return $this->clickLink($label, $index);
     }
diff --git a/core/modules/views_ui/src/Tests/DisplayAttachmentTest.php b/core/modules/views_ui/src/Tests/DisplayAttachmentTest.php
index 68fa2b3..ebeb658 100644
--- a/core/modules/views_ui/src/Tests/DisplayAttachmentTest.php
+++ b/core/modules/views_ui/src/Tests/DisplayAttachmentTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 
 /**
@@ -35,7 +36,7 @@ public function testAttachmentUI() {
     $this->drupalGet($attachment_display_url);
 
     foreach (array('default', 'page-1') as $display_id) {
-      $this->assertNoFieldChecked("edit-displays-$display_id", format_string('Make sure the @display_id can be marked as attached', array('@display_id' => $display_id)));
+      $this->assertNoFieldChecked("edit-displays-$display_id", String::format('Make sure the @display_id can be marked as attached', array('@display_id' => $display_id)));
     }
 
     // Save the attachments and test the value on the view.
diff --git a/core/modules/views_ui/src/Tests/DisplayTest.php b/core/modules/views_ui/src/Tests/DisplayTest.php
index 9fb9866..eba1ad6 100644
--- a/core/modules/views_ui/src/Tests/DisplayTest.php
+++ b/core/modules/views_ui/src/Tests/DisplayTest.php
@@ -177,7 +177,7 @@ public function testPageContextualLinks() {
     $this->drupalGet('test-display');
     $id = 'entity.view.edit_form:view=test_display:location=page&name=test_display&display_id=page_1';
     // @see \Drupal\contextual\Tests\ContextualDynamicContextTest:assertContextualLinkPlaceHolder()
-    $this->assertRaw('<div' . new Attribute(array('data-contextual-id' => $id)) . '></div>', format_string('Contextual link placeholder with id @id exists.', array('@id' => $id)));
+    $this->assertRaw('<div' . new Attribute(array('data-contextual-id' => $id)) . '></div>', String::format('Contextual link placeholder with id @id exists.', array('@id' => $id)));
 
     // Get server-rendered contextual links.
     // @see \Drupal\contextual\Tests\ContextualDynamicContextTest:renderContextualLinks()
diff --git a/core/modules/views_ui/src/Tests/StorageTest.php b/core/modules/views_ui/src/Tests/StorageTest.php
index 73fe632..e008fac 100644
--- a/core/modules/views_ui/src/Tests/StorageTest.php
+++ b/core/modules/views_ui/src/Tests/StorageTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\views\Views;
 
@@ -54,7 +55,7 @@ public function testDetails() {
     $view = Views::getView($view_name);
 
     foreach (array('label', 'tag', 'description', 'langcode') as $property) {
-      $this->assertEqual($view->storage->get($property), $edit[$property], format_string('Make sure the property @property got probably saved.', array('@property' => $property)));
+      $this->assertEqual($view->storage->get($property), $edit[$property], String::format('Make sure the property @property got probably saved.', array('@property' => $property)));
     }
   }
 
diff --git a/core/modules/views_ui/src/Tests/TagTest.php b/core/modules/views_ui/src/Tests/TagTest.php
index 673b91f..7c7ede1 100644
--- a/core/modules/views_ui/src/Tests/TagTest.php
+++ b/core/modules/views_ui/src/Tests/TagTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Tests\ViewUnitTestBase;
 use Drupal\views_ui\Controller\ViewsUIController;
 
@@ -53,7 +54,7 @@ public function testViewsUiAutocompleteTag() {
     $matches = (array) json_decode($result->getContent());
     $this->assertEqual(count($matches), 8, 'Make sure that only a subset is returned.');
     foreach ($matches as $tag) {
-      $this->assertTrue(array_search($tag, $tags) !== FALSE, format_string('Make sure the returned tag @tag actually exists.', array('@tag' => $tag)));
+      $this->assertTrue(array_search($tag, $tags) !== FALSE, String::format('Make sure the returned tag @tag actually exists.', array('@tag' => $tag)));
     }
 
     // Make sure an invalid result doesn't return anything.
diff --git a/core/tests/Drupal/Tests/Core/Logger/LogMessageParserTest.php b/core/tests/Drupal/Tests/Core/Logger/LogMessageParserTest.php
index f361456..c804cad 100644
--- a/core/tests/Drupal/Tests/Core/Logger/LogMessageParserTest.php
+++ b/core/tests/Drupal/Tests/Core/Logger/LogMessageParserTest.php
@@ -54,12 +54,13 @@ public function providerTestParseMessagePlaceholders() {
         array('message' => 'User {username} created', 'context' => array('username' => 'Dries')),
         array('message' => 'User @username created', 'context' => array('@username' => 'Dries')),
       ),
-      // PSR3 style mixed in a format_string style message.
+      // PSR3 style mixed in a \Drupal\Component\Utility\String::format style
+      // message.
       array(
         array('message' => 'User {username} created @time', 'context' => array('username' => 'Dries', '@time' => 'now')),
         array('message' => 'User @username created @time', 'context' => array('@username' => 'Dries', '@time' => 'now')),
       ),
-      // format_string style message only.
+      // \Drupal\Component\Utility\String::format style message only.
       array(
         array('message' => 'User @username created', 'context' => array('@username' => 'Dries')),
         array('message' => 'User @username created', 'context' => array('@username' => 'Dries')),
