diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index a704ebf..ee2af37 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -337,7 +337,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)));
 }
 
 /**
@@ -984,18 +984,18 @@ function drupal_serve_page_from_cache(stdClass $cache, Response $response, Reque
  * $text = t("@name's blog", array('@name' => user_format_name($account)));
  * @endcode
  * 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.)
- * Translators can then rearrange the string as necessary for the language
- * (e.g., in Spanish, it might be "blog de @name").
+ * substitute their sanitized values at translation time. (See the Localization
+ * API pages referenced above and the documentation of
+ * \Drupal\Component\Utility\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").
  *
  * @param $string
  *   A string containing the English string to translate.
  * @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
@@ -1006,7 +1006,7 @@ function drupal_serve_page_from_cache(stdClass $cache, Response $response, Reque
  * @return
  *   The translated string.
  *
- * @see format_string()
+ * @see \Drupal\Component\Utility\String::format()
  * @ingroup sanitization
  */
 function t($string, array $args = array(), array $options = array()) {
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 9ec0e86..b8d72b3 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -774,10 +774,11 @@ function format_xml_elements($array) {
  *   "@count new comments".
  * @param $args
  *   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.
+ *   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
+ *   \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.
  *
@@ -785,7 +786,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 56c276f..4a9b7ea 100644
--- a/core/includes/errors.inc
+++ b/core/includes/errors.inc
@@ -164,7 +164,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;
     }
   }
@@ -174,7 +174,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;
     }
@@ -200,7 +200,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 eba7541..05eccc3 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;
 
 /**
@@ -59,7 +60,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 ee2bebc..578d547 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\EntityStorageInterface;
 use Drupal\Core\Entity\ContentEntityDatabaseStorage;
@@ -215,7 +216,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)));
         }
       }
     }
@@ -238,7 +239,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/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php
index a20b9b9..6f25090 100644
--- a/core/lib/Drupal/Core/Extension/ModuleHandler.php
+++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Extension;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Graph\Graph;
 use Symfony\Component\Yaml\Parser;
 use Drupal\Component\Utility\NestedArray;
@@ -588,7 +589,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/Extension/UpdateModuleHandler.php b/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php
index 4327aac..23f4f60 100644
--- a/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php
+++ b/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Extension;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Config\ConfigException;
 use Drupal\Core\Config\FileStorage;
 
@@ -111,7 +112,7 @@ public function install(array $module_list, $enable_dependencies = TRUE) {
           // If this file already exists, something in the upgrade path went
           // completely wrong and we want to know.
           if ($config_storage->exists($config_name)) {
-            throw new ConfigException(format_string('Default configuration file @name of @module module unexpectedly exists already before the module was installed.', array(
+            throw new ConfigException(String::format('Default configuration file @name of @module module unexpectedly exists already before the module was installed.', array(
               '@module' => $module,
               '@name' => $config_name,
             )));
diff --git a/core/lib/Drupal/Core/StringTranslation/TranslationInterface.php b/core/lib/Drupal/Core/StringTranslation/TranslationInterface.php
index c3610ff..8b373cc 100644
--- a/core/lib/Drupal/Core/StringTranslation/TranslationInterface.php
+++ b/core/lib/Drupal/Core/StringTranslation/TranslationInterface.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\Core\StringTranslation;
 
+use Drupal\Component\Utility\String;
+
 interface TranslationInterface {
 
   /**
@@ -63,10 +65,11 @@ public function translate($string, array $args = array(), array $options = array
    *   "@count new comments".
    * @param array $args
    *   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.
+   *   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 \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.
    *
@@ -76,7 +79,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 be253e1..f5b7c8e 100644
--- a/core/lib/Drupal/Core/TypedData/ListDataDefinition.php
+++ b/core/lib/Drupal/Core/TypedData/ListDataDefinition.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\Core\TypedData;
 
+use Drupal\Component\Utility\String;
+
 /**
  * A typed data definition class for defining lists.
  */
@@ -87,7 +89,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 88d63ec..a100ef7 100644
--- a/core/lib/Drupal/Core/TypedData/TypedDataManager.php
+++ b/core/lib/Drupal/Core/TypedData/TypedDataManager.php
@@ -88,7 +88,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
@@ -169,7 +169,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);
@@ -189,7 +189,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/lib/Drupal/action/Tests/BulkFormTest.php b/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php
index d5dda7a..9910df6 100644
--- a/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php
+++ b/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\action\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 use Drupal\views\Views;
 
@@ -64,7 +65,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;
     }
 
@@ -74,7 +75,7 @@ public function testBulkForm() {
 
     foreach ($nodes as $node) {
       $changed_node = node_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/lib/Drupal/aggregator/Tests/AggregatorConfigurationTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorConfigurationTest.php
index a3d9a44..13aaa05 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorConfigurationTest.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorConfigurationTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\aggregator\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Tests functionality of the configuration settings in the Aggregator module.
  */
@@ -45,7 +47,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/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php
index 161d215..a09e6d1 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php
@@ -61,7 +61,7 @@ public function testBlockLinks() {
     // Find the expected read_more link.
     $href = 'aggregator/sources/' . $feed->id();
     $links = $this->xpath('//a[@href = :href]', array(':href' => url($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)));
 
     // Visit that page.
     $this->drupalGet($href);
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php
index e900025..0b66ff7 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\aggregator\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 use Drupal\simpletest\WebTestBase;
 use Drupal\aggregator\FeedInterface;
@@ -54,7 +55,7 @@ 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'])), format_string('The feed !name has been added.', array('!name' => $edit['title'])));
+    $this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title'])), String::format('The feed !name has been added.', array('!name' => $edit['title'])));
 
     $fid = db_query("SELECT fid FROM {aggregator_feed} WHERE title = :title AND url = :url", array(':title' => $edit['title'], ':url' => $edit['url']))->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/lib/Drupal/aggregator/Tests/FeedParserTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php
index 96ee61f..65534ba 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\aggregator\Tests;
 
+use Drupal\Component\Utility\String;
 use Zend\Feed\Reader\Reader;
 
 /**
@@ -41,7 +42,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.');
@@ -63,7 +64,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.');
@@ -77,7 +78,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/lib/Drupal/aggregator/Tests/UpdateFeedItemTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedItemTest.php
index dc9c212..20a8aa3 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedItemTest.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedItemTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\aggregator\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Tests functionality of updating a feed item in the Aggregator module.
  */
@@ -42,10 +44,10 @@ function testUpdateFeedItem() {
     );
 
     $this->drupalGet($edit['url']);
-    $this->assertResponse(array(200), format_string('URL !url is accessible', array('!url' => $edit['url'])));
+    $this->assertResponse(array(200), String::format('URL !url is accessible', array('!url' => $edit['url'])));
 
     $this->drupalPostForm('aggregator/sources/add', $edit, t('Save'));
-    $this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title'])), format_string('The feed !name has been added.', array('!name' => $edit['title'])));
+    $this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title'])), String::format('The feed !name has been added.', array('!name' => $edit['title'])));
 
     $fid = db_query("SELECT fid FROM {aggregator_feed} WHERE url = :url", array(':url' => $edit['url']))->fetchField();
     $feed = aggregator_feed_load($fid);
@@ -67,7 +69,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/lib/Drupal/aggregator/Tests/UpdateFeedTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedTest.php
index de919ec..b91d8c5 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedTest.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\aggregator\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Tests functionality of updating the feed in the Aggregator module.
  */
@@ -34,7 +36,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'])), format_string('The feed %name has been updated.', array('%name' => $edit['title'])));
+      $this->assertRaw(t('The feed %name has been updated.', array('%name' => $edit['title'])), String::format('The feed %name has been updated.', array('%name' => $edit['title'])));
 
       // Check feed data.
       $this->assertEqual($this->getUrl(), url('aggregator/sources/' . $feed->id(), array('absolute' => TRUE)));
diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php
index 4111596..413847e 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockCreationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\custom_block\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Database\Database;
 
 /**
@@ -65,7 +66,7 @@ public function testCustomBlockCreation() {
     $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"]
     )), 'Basic block created.');
@@ -91,7 +92,7 @@ public function testCustomBlockCreation() {
     $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"]
     )));
     $this->assertResponse(200);
@@ -111,7 +112,7 @@ public function testDefaultCustomBlockCreation() {
     $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"],
     )), 'Basic block created.');
diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockRevisionsTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockRevisionsTest.php
index 75f19aa..5d7933c 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockRevisionsTest.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockRevisionsTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\custom_block\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Tests the block revision functionality.
  */
@@ -76,7 +78,7 @@ public function testRevisions() {
       // Confirm the correct revision text appears.
       $loaded = entity_revision_load('custom_block', $revision_id);
       // Verify 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/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php
index 5bd711c..5a9da41 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\custom_block\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 
 /**
@@ -71,7 +72,7 @@ public function testPageEdit() {
     // Test deleting the block.
     $this->drupalGet("block/" . $revised_block->id());
     $this->drupalPostForm(NULL, array(), 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/block/lib/Drupal/block/BlockFormController.php b/core/modules/block/lib/Drupal/block/BlockFormController.php
index c4efba1..e3923d3 100644
--- a/core/modules/block/lib/Drupal/block/BlockFormController.php
+++ b/core/modules/block/lib/Drupal/block/BlockFormController.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\block;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Entity\EntityFormController;
@@ -205,7 +206,7 @@ public function form(array $form, array &$form_state) {
     }
 
     // Per-role visibility.
-    $role_options = array_map('check_plain', user_role_names());
+    $role_options = array_map('String::checkPlain', user_role_names());
     $form['visibility']['role'] = array(
       '#type' => 'details',
       '#title' => $this->t('Roles'),
diff --git a/core/modules/block/lib/Drupal/block/BlockViewBuilder.php b/core/modules/block/lib/Drupal/block/BlockViewBuilder.php
index a6a925a..26e4d4b 100644
--- a/core/modules/block/lib/Drupal/block/BlockViewBuilder.php
+++ b/core/modules/block/lib/Drupal/block/BlockViewBuilder.php
@@ -66,7 +66,7 @@ public function viewMultiple(array $entities = array(), $view_mode = 'full', $la
         // @todo Remove after fixing http://drupal.org/node/1989568.
         '#block' => $entity,
       );
-      $build[$entity_id]['#configuration']['label'] = check_plain($configuration['label']);
+      $build[$entity_id]['#configuration']['label'] = String::checkPlain($configuration['label']);
 
       // Set cache tags; these always need to be set, whether the block is
       // cacheable or not, so that the page cache is correctly informed.
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
index 4fa4e63..da64e80 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\block\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Cache\Cache;
 use Drupal\simpletest\WebTestBase;
 
@@ -235,7 +236,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/lib/Drupal/block/Tests/Views/DisplayBlockTest.php b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php
index ca906ea..1fa12d9 100644
--- a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php
@@ -276,8 +276,8 @@ public function testBlockContextualLinks() {
     $id = 'block:block=' . $block->id() . ':|views_ui_edit:view=test_view_block:location=block&name=test_view_block&display_id=block_1';
     $cached_id = 'block:block=' . $cached_block->id() . ':|views_ui_edit: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/book/lib/Drupal/book/Tests/BookTest.php b/core/modules/book/lib/Drupal/book/Tests/BookTest.php
index 667f089..1db0d1a 100644
--- a/core/modules/book/lib/Drupal/book/Tests/BookTest.php
+++ b/core/modules/book/lib/Drupal/book/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;
 
@@ -185,10 +186,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.
@@ -350,7 +351,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/breakpoint/lib/Drupal/breakpoint/Entity/Breakpoint.php b/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/Breakpoint.php
index e200894..ae41b83 100644
--- a/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/Breakpoint.php
+++ b/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/Breakpoint.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\breakpoint\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Config\Entity\ConfigEntityBase;
 use Drupal\breakpoint\BreakpointInterface;
 use Drupal\breakpoint\InvalidBreakpointException;
@@ -147,17 +148,17 @@ public function isValid() {
         Breakpoint::SOURCE_TYPE_MODULE,
         Breakpoint::SOURCE_TYPE_THEME)
       )) {
-      throw new InvalidBreakpointSourceTypeException(format_string('Invalid source type @source_type', array(
+      throw new InvalidBreakpointSourceTypeException(String::format('Invalid source type @source_type', array(
         '@source_type' => $this->sourceType,
       )));
     }
     // Check for illegal characters in breakpoint source.
     if (preg_match('/[^0-9a-z_]+/', $this->source)) {
-      throw new InvalidBreakpointSourceException(format_string("Invalid value '@source' for breakpoint source property. Breakpoint source property can only contain lowercase alphanumeric characters and underscores.", array('@source' => $this->source)));
+      throw new InvalidBreakpointSourceException(String::format("Invalid value '@source' for breakpoint source property. Breakpoint source property can only contain lowercase alphanumeric characters and underscores.", array('@source' => $this->source)));
     }
     // Check for illegal characters in breakpoint names.
     if (preg_match('/[^0-9a-z_\-]/', $this->name)) {
-      throw new InvalidBreakpointNameException(format_string("Invalid value '@name' for breakpoint name property. Breakpoint name property can only contain lowercase alphanumeric characters, underscores (_), and hyphens (-).", array('@name' => $this->name)));
+      throw new InvalidBreakpointNameException(String::format("Invalid value '@name' for breakpoint name property. Breakpoint name property can only contain lowercase alphanumeric characters, underscores (_), and hyphens (-).", array('@name' => $this->name)));
     }
     return $this::isValidMediaQuery($this->mediaQuery);
   }
diff --git a/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php b/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php
index 9840657d..ebbb379 100644
--- a/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php
+++ b/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\breakpoint\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Config\Entity\ConfigEntityBase;
 use Drupal\breakpoint\BreakpointGroupInterface;
 use Drupal\breakpoint\InvalidBreakpointSourceException;
@@ -120,17 +121,17 @@ public function isValid() {
         Breakpoint::SOURCE_TYPE_MODULE,
         Breakpoint::SOURCE_TYPE_THEME)
       )) {
-      throw new InvalidBreakpointSourceTypeException(format_string('Invalid source type @source_type', array(
+      throw new InvalidBreakpointSourceTypeException(String::format('Invalid source type @source_type', array(
         '@source_type' => $this->sourceType,
       )));
     }
     // Check for illegal characters in breakpoint group source.
     if (preg_match('/[^a-z_]+/', $this->source) || empty($this->source)) {
-      throw new InvalidBreakpointSourceException(format_string("Invalid value '@source' for breakpoint group source property. Breakpoint group source property can only contain lowercase letters and underscores.", array('@source' => $this->source)));
+      throw new InvalidBreakpointSourceException(String::format("Invalid value '@source' for breakpoint group source property. Breakpoint group source property can only contain lowercase letters and underscores.", array('@source' => $this->source)));
     }
     // Check for illegal characters in breakpoint group name.
     if (preg_match('/[^a-z0-9_]+/', $this->name || empty($this->name))) {
-      throw new InvalidBreakpointNameException(format_string("Invalid value '@name' for breakpoint group name property. Breakpoint group name property can only contain lowercase letters, numbers and underscores.", array('@name' => $this->name)));
+      throw new InvalidBreakpointNameException(String::format("Invalid value '@name' for breakpoint group name property. Breakpoint group name property can only contain lowercase letters, numbers and underscores.", array('@name' => $this->name)));
     }
     return TRUE;
   }
diff --git a/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointGroupTestBase.php b/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointGroupTestBase.php
index 95141e3..76824e6 100644
--- a/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointGroupTestBase.php
+++ b/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointGroupTestBase.php
@@ -6,6 +6,7 @@
 
 namespace Drupal\breakpoint\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 use Drupal\breakpoint\Entity\BreakpointGroup;
 
@@ -45,7 +46,7 @@ public function verifyBreakpointGroup(BreakpointGroup $group, BreakpointGroup $c
         '%property' => $property,
       );
       if (is_array($compare_set->{$property})) {
-        $this->assertEqual(array_keys($compare_set->{$property}), array_keys($group->{$property}), format_string('breakpoint_group_load: Proper %property for breakpoint group %group.', $t_args), 'Breakpoint API');
+        $this->assertEqual(array_keys($compare_set->{$property}), array_keys($group->{$property}), String::format('breakpoint_group_load: Proper %property for breakpoint group %group.', $t_args), 'Breakpoint API');
       }
       else {
         $t_args = array(
@@ -54,7 +55,7 @@ public function verifyBreakpointGroup(BreakpointGroup $group, BreakpointGroup $c
           '%property1' => $compare_set->{$property},
           '%property2' => $group->{$property},
         );
-        $this->assertEqual($compare_set->{$property}, $group->{$property}, format_string('breakpoint_group_load: Proper %property: %property1 == %property2 for breakpoint group %group.', $t_args), 'Breakpoint API');
+        $this->assertEqual($compare_set->{$property}, $group->{$property}, String::format('breakpoint_group_load: Proper %property: %property1 == %property2 for breakpoint group %group.', $t_args), 'Breakpoint API');
       }
     }
 
diff --git a/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointTestBase.php b/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointTestBase.php
index 89d0cc1..7a11201 100644
--- a/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointTestBase.php
+++ b/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointTestBase.php
@@ -6,6 +6,7 @@
 
 namespace Drupal\breakpoint\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 use Drupal\breakpoint\Entity\Breakpoint;
 
@@ -45,7 +46,7 @@ public function verifyBreakpoint(Breakpoint $breakpoint, Breakpoint $compare_bre
         '%breakpoint' => $breakpoint->label(),
         '%property' => $property,
       );
-      $this->assertEqual($compare_breakpoint->{$property}, $breakpoint->{$property}, format_string('breakpoint_load: Proper %property for breakpoint %breakpoint.', $t_args), 'Breakpoint API');
+      $this->assertEqual($compare_breakpoint->{$property}, $breakpoint->{$property}, String::format('breakpoint_load: Proper %property for breakpoint %breakpoint.', $t_args), 'Breakpoint API');
     }
   }
 }
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index e353501..a0929ca 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -10,6 +10,7 @@
  * book page, user etc.
  */
 
+use Drupal\Component\Utility\String;
 use Drupal\comment\CommentInterface;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
 use Drupal\Core\Entity\EntityInterface;
@@ -1207,7 +1208,7 @@ function comment_preview(CommentInterface $comment, array &$form_state) {
 
     if (!empty($account) && $account->isAuthenticated()) {
       $comment->setOwner($account);
-      $comment->setAuthorName(check_plain($account->getUsername()));
+      $comment->setAuthorName(String::checkPlain($account->getUsername()));
     }
     elseif (empty($author_name)) {
       $comment->setAuthorName(\Drupal::config('user.settings')->get('anonymous'));
diff --git a/core/modules/comment/comment.tokens.inc b/core/modules/comment/comment.tokens.inc
index b58230a..3ec7eb1 100644
--- a/core/modules/comment/comment.tokens.inc
+++ b/core/modules/comment/comment.tokens.inc
@@ -5,6 +5,8 @@
  * Builds placeholder replacement tokens for comment-related data.
  */
 
+use Drupal\Component\Utility\String;
+
 /**
  * Implements hook_token_info().
  */
@@ -139,12 +141,12 @@ function comment_tokens($type, $tokens, array $data = array(), array $options =
 
         // Poster identity information for comments.
         case 'hostname':
-          $replacements[$original] = $sanitize ? check_plain($comment->getHostname()) : $comment->getHostname();
+          $replacements[$original] = $sanitize ? String::checkPlain($comment->getHostname()) : $comment->getHostname();
           break;
 
         case 'mail':
           $mail = $comment->getAuthorEmail();
-          $replacements[$original] = $sanitize ? check_plain($mail) : $mail;
+          $replacements[$original] = $sanitize ? String::checkPlain($mail) : $mail;
           break;
 
         case 'homepage':
diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php
index 8197784..e6331e0 100644
--- a/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php
+++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Plugin\views\argument;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Database\Connection;
 use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -64,7 +65,7 @@ function title() {
       return t('No user');
     }
 
-    return check_plain($title);
+    return String::checkPlain($title);
   }
 
   protected function defaultActions($which = NULL) {
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php
index 24a20a9..694efea 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\field\Field;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
 
@@ -59,7 +60,7 @@ function testCommentDefaultFields() {
     $field = $this->container->get('field.info')->getField('comment', 'comment_body');
     $this->assertTrue($field, 'The comment_body field exists');
     $instances = $this->container->get('field.info')->getInstances('comment');
-    $this->assertTrue(isset($instances['node__comment']['comment_body']), format_string('The comment_body field is present for comments on type @type', array('@type' => $type_name)));
+    $this->assertTrue(isset($instances['node__comment']['comment_body']), 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);
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php
index 56444a9..9dc60e3 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
 use Drupal\simpletest\WebTestBase;
 
@@ -127,7 +128,7 @@ function testCommentLanguage() {
           ->fetchField();
         $comment = comment_load($cid);
         $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/lib/Drupal/comment/Tests/CommentNonNodeTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php
index d4af65e..a68fb46 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\comment\CommentInterface;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
 use Drupal\simpletest\WebTestBase;
@@ -198,10 +199,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/lib/Drupal/comment/Tests/CommentPagerTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentPagerTest.php
index d1e447bf..4a889ba 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentPagerTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentPagerTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\comment\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Verifies pagination of comments.
  */
@@ -187,7 +189,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))));
   }
 
   /**
@@ -247,7 +249,7 @@ function testCommentNewPageIndicator() {
     foreach ($expected_pages as $new_replies => $expected_page) {
       $returned = comment_new_page_count($node->get('comment')->comment_count, $new_replies, $node);
       $returned_page = is_array($returned) ? $returned['page'] : 0;
-      $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', COMMENT_MODE_THREADED, 'Switched to threaded mode.');
@@ -265,7 +267,7 @@ function testCommentNewPageIndicator() {
     foreach ($expected_pages as $new_replies => $expected_page) {
       $returned = comment_new_page_count($node->get('comment')->comment_count, $new_replies, $node);
       $returned_page = is_array($returned) ? $returned['page'] : 0;
-      $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/lib/Drupal/comment/Tests/CommentTestBase.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
index c1edf13..3f979a0 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 use Drupal\comment\CommentInterface;
 use Drupal\simpletest\WebTestBase;
@@ -238,7 +239,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);
   }
 
   /**
@@ -265,7 +266,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)));
   }
 
   /**
@@ -278,7 +279,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);
   }
 
   /**
@@ -330,10 +331,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/lib/Drupal/comment/Tests/CommentThreadingTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php
index f69b55f..b20d133 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 
 /**
@@ -136,7 +137,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,
@@ -159,7 +160,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/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php
index bd300fc..d902f54 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 
 /**
@@ -53,10 +54,10 @@ function testCommentTokenReplacement() {
     // Generate and test sanitized tokens.
     $tests = array();
     $tests['[comment:cid]'] = $comment->id();
-    $tests['[comment:hostname]'] = check_plain($comment->getHostname());
+    $tests['[comment:hostname]'] = String::checkPlain($comment->getHostname());
     $tests['[comment:name]'] = filter_xss($comment->getAuthorName());
     $tests['[comment:author]'] = filter_xss($comment->getAuthorName());
-    $tests['[comment:mail]'] = check_plain($this->admin_user->getEmail());
+    $tests['[comment:mail]'] = String::checkPlain($this->admin_user->getEmail());
     $tests['[comment:homepage]'] = check_url($comment->getHomepage());
     $tests['[comment:title]'] = filter_xss($comment->getSubject());
     $tests['[comment:body]'] = $comment->comment_body->processed;
@@ -65,18 +66,18 @@ function testCommentTokenReplacement() {
     $tests['[comment:created:since]'] = format_interval(REQUEST_TIME - $comment->getCreatedTime(), 2, $language_interface->id);
     $tests['[comment:changed:since]'] = format_interval(REQUEST_TIME - $comment->getChangedTime(), 2, $language_interface->id);
     $tests['[comment:parent:cid]'] = $comment->hasParentComment() ? $comment->getParentComment()->id() : NULL;
-    $tests['[comment:parent:title]'] = check_plain($parent_comment->getSubject());
+    $tests['[comment:parent:title]'] = String::checkPlain($parent_comment->getSubject());
     $tests['[comment:node:nid]'] = $comment->getCommentedEntityId();
-    $tests['[comment:node:title]'] = check_plain($node->getTitle());
+    $tests['[comment:node:title]'] = String::checkPlain($node->getTitle());
     $tests['[comment:author:uid]'] = $comment->getOwnerId();
-    $tests['[comment:author:name]'] = check_plain($this->admin_user->getUsername());
+    $tests['[comment:author:name]'] = String::checkPlain($this->admin_user->getUsername());
 
     // Test to make sure that we generated something for each token.
     $this->assertFalse(in_array(0, array_map('strlen', $tests)), 'No empty tokens generated.');
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('comment' => $comment), array('langcode' => $language_interface->id));
-      $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.
@@ -93,7 +94,7 @@ function testCommentTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('comment' => $comment), array('langcode' => $language_interface->id, '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)));
     }
 
     // Load node so comment_count gets computed.
@@ -108,7 +109,7 @@ function testCommentTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('entity' => $node, 'node' => $node), array('langcode' => $language_interface->id));
-      $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/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php b/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php
index fad5f36..992ec3f 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Tests\Views;
 
+use Drupal\Component\Utility\String;
 use Drupal\comment\CommentInterface;
 use Drupal\views\Views;
 use Drupal\views\Tests\ViewTestBase;
@@ -134,7 +135,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/lib/Drupal/config/Tests/ConfigCRUDTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php
index 7576163..76bb650 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php
@@ -169,7 +169,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/lib/Drupal/config/Tests/ConfigDiffTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigDiffTest.php
index 57e0553..2ebb2e2 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigDiffTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigDiffTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\config\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\DrupalUnitTestBase;
 
 /**
@@ -58,8 +59,8 @@ function testDiff() {
     // Verify that the diff reflects a change.
     $diff = \Drupal::service('config.manager')->diff($active, $staging, $config_name);
     $this->assertEqual($diff->edits[0]->type, 'change', 'The first item in the diff is a change.');
-    $this->assertEqual($diff->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($diff->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($diff->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($diff->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;
@@ -70,8 +71,8 @@ function testDiff() {
     $diff = \Drupal::service('config.manager')->diff($active, $staging, $config_name);
     $this->assertEqual($diff->edits[0]->type, 'copy', 'The first item in the diff is a copy.');
     $this->assertEqual($diff->edits[1]->type, 'delete', 'The second item in the diff is a delete.');
-    $this->assertEqual($diff->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($diff->edits[1]->closing, format_string("The key '%remove_key' does not exist in staging.", array('%remove_key' => $remove_key)));
+    $this->assertEqual($diff->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($diff->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;
@@ -82,8 +83,8 @@ function testDiff() {
     $diff = \Drupal::service('config.manager')->diff($active, $staging, $config_name);
     $this->assertEqual($diff->edits[0]->type, 'copy', 'The first item in the diff is a copy.');
     $this->assertEqual($diff->edits[1]->type, 'add', 'The second item in the diff is an add.');
-    $this->assertFalse($diff->edits[1]->orig, format_string("The key '%add_key' does not exist in active.", array('%add_key' => $add_key)));
-    $this->assertEqual($diff->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($diff->edits[1]->orig, String::format("The key '%add_key' does not exist in active.", array('%add_key' => $add_key)));
+    $this->assertEqual($diff->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)));
   }
 
-}
\ No newline at end of file
+}
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageTest.php
index 854882e..4d9e073 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageTest.php
+++ b/core/modules/config/lib/Drupal/config/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;
 
@@ -51,7 +52,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/lib/Drupal/config/Tests/ConfigEntityTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php
index 19ebaff..6b62aaa 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\config\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityMalformedException;
 use Drupal\Core\Entity\EntityStorageException;
 use Drupal\Core\Language\Language;
@@ -190,9 +191,9 @@ function testCRUDUI() {
     $label1 = $this->randomName();
     $label2 = $this->randomName();
     $label3 = $this->randomName();
-    $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(
@@ -263,7 +264,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/lib/Drupal/config/Tests/ConfigFileContentTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php
index a73155d..0533955 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php
+++ b/core/modules/config/lib/Drupal/config/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;
 
@@ -117,16 +118,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/lib/Drupal/config/Tests/ConfigImportUITest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php
index 51f9182..35f5950 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\config\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -158,7 +159,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/lib/Drupal/config_test/ConfigTestFormController.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestFormController.php
index 18dcee6..a5f2891 100644
--- a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestFormController.php
+++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestFormController.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\config_test;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityFormController;
 
 /**
@@ -73,10 +74,10 @@ public function save(array $form, array &$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['redirect_route']['route_name'] = 'config_test.list_page';
diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationUiTest.php b/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationUiTest.php
index 405aaf5..43f7b80 100644
--- a/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationUiTest.php
+++ b/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationUiTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\config_translation\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Json;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Config\FileStorage;
@@ -689,12 +690,12 @@ public function testThemeDiscovery() {
    */
   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/lib/Drupal/contact/Tests/ContactSitewideTest.php b/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
index 126fc75..723d000 100644
--- a/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
+++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\contact\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\simpletest\WebTestBase;
 
@@ -66,7 +67,7 @@ function testSiteWideContact() {
     $edit_link = $this->xpath('//a[@href=:href]', array(
       ':href' => url('admin/structure/contact/manage/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');
@@ -405,7 +406,7 @@ function deleteCategories() {
       else {
         $this->drupalPostForm("admin/structure/contact/manage/$id/delete", array(), t('Delete'));
         $this->assertRaw(t('Category %label has been deleted.', array('%label' => $category->label())));
-        $this->assertFalse(entity_load('contact_category', $id), format_string('Category %category not found', array('%category' => $category->label())));
+        $this->assertFalse(entity_load('contact_category', $id), String::format('Category %category not found', array('%category' => $category->label())));
       }
     }
   }
diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationSettingsTest.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationSettingsTest.php
index a8e1a0c..3f80925 100644
--- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationSettingsTest.php
+++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationSettingsTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\content_translation\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 use Drupal\field\Field as FieldService;
 use Drupal\simpletest\WebTestBase;
@@ -170,7 +171,7 @@ function testSettingsUI() {
   protected function assertSettings($entity_type, $bundle, $enabled, $edit) {
     $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save'));
     $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);
     field_info_cache_clear();
     entity_info_cache_clear();
     return $this->assertEqual(content_translation_enabled($entity_type, $bundle), $enabled, $message);
diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationSyncImageTest.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationSyncImageTest.php
index 3f990db..ab3bed3 100644
--- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationSyncImageTest.php
+++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationSyncImageTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\content_translation\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Language\Language;
 
@@ -207,13 +208,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(
@@ -239,7 +240,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/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php
index 96bf8b2..4beb77b 100644
--- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php
+++ b/core/modules/content_translation/lib/Drupal/content_translation/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;
@@ -59,7 +60,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);
     }
 
@@ -95,7 +96,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);
       }
     }
@@ -110,7 +111,7 @@ protected function doTestTranslationOverview() {
 
     foreach ($this->langcodes as $langcode) {
       if ($entity->hasTranslation($langcode)) {
-        $this->assertText($entity->getTranslation($langcode)->label(), format_string('Label correctly shown for %language translation', array('%language' => $langcode)));
+        $this->assertText($entity->getTranslation($langcode)->label(), String::format('Label correctly shown for %language translation', array('%language' => $langcode)));
       }
     }
   }
diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationWorkflowsTest.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationWorkflowsTest.php
index 861aec9..812cea1 100644
--- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationWorkflowsTest.php
+++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationWorkflowsTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\content_translation\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 use Drupal\user\UserInterface;
 
@@ -99,10 +100,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)));
         }
       }
     }
@@ -127,14 +128,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";
@@ -150,7 +151,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];
@@ -176,7 +177,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/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php b/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php
index 4e1e6d0..30ef7f3 100644
--- a/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php
+++ b/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\contextual\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Json;
 use Drupal\simpletest\WebTestBase;
 use Drupal\Core\Template\Attribute;
@@ -122,7 +123,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)));
   }
 
   /**
@@ -134,7 +135,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/lib/Drupal/datetime/Tests/DateTimeFieldTest.php b/core/modules/datetime/lib/Drupal/datetime/Tests/DateTimeFieldTest.php
index 76b4cb9..dd17508 100644
--- a/core/modules/datetime/lib/Drupal/datetime/Tests/DateTimeFieldTest.php
+++ b/core/modules/datetime/lib/Drupal/datetime/Tests/DateTimeFieldTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\datetime\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\entity\Entity\EntityViewDisplay;
 use Drupal\simpletest\WebTestBase;
 use Drupal\Core\Datetime\DrupalDateTime;
@@ -139,7 +140,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;
         }
       }
@@ -152,7 +153,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)));
   }
 
   /**
@@ -207,7 +208,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;
         }
       }
@@ -220,7 +221,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)));
   }
 
   /**
@@ -385,7 +386,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(
@@ -393,7 +394,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(
@@ -401,7 +402,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 = '';
@@ -419,7 +420,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';
@@ -428,7 +429,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';
@@ -437,7 +438,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/lib/Drupal/dblog/Tests/DbLogTest.php b/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php
index 24add00..3aa422a 100644
--- a/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php
+++ b/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\dblog\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 use Drupal\dblog\Controller\DbLogController;
 use Drupal\simpletest\WebTestBase;
@@ -90,7 +91,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)));
   }
 
   /**
@@ -104,14 +105,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)));
   }
 
   /**
@@ -228,7 +229,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.
@@ -241,7 +242,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);
@@ -314,7 +315,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'));
@@ -427,14 +428,14 @@ protected function testDBLogAddAndClear() {
     // Add a watchdog entry.
     dblog_watchdog($log);
     // Make sure the table count has actually been incremented.
-    $this->assertEqual($count + 1, db_query('SELECT COUNT(*) FROM {watchdog}')->fetchField(), format_string('dblog_watchdog() added an entry to the dblog :count', array(':count' => $count)));
+    $this->assertEqual($count + 1, db_query('SELECT COUNT(*) FROM {watchdog}')->fetchField(), String::format('dblog_watchdog() 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.
     $this->drupalPostForm('admin/reports/dblog', array(), t('Clear log messages'));
     // 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/editor.module b/core/modules/editor/editor.module
index abebdb9..f26544d 100644
--- a/core/modules/editor/editor.module
+++ b/core/modules/editor/editor.module
@@ -5,6 +5,7 @@
  * Adds bindings for client-side "text editors" to text formats.
  */
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Html;
 use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\editor\Entity\Editor;
@@ -78,7 +79,7 @@ function editor_form_filter_admin_overview_alter(&$form, $form_state) {
   $editors = \Drupal::service('plugin.manager.editor')->getDefinitions();
   foreach (element_children($form['formats']) as $format_id) {
     $editor = editor_load($format_id);
-    $editor_name = ($editor && isset($editors[$editor->editor])) ? $editors[$editor->editor]['label'] : drupal_placeholder('—');
+    $editor_name = ($editor && isset($editors[$editor->editor])) ? $editors[$editor->editor]['label'] : String::placeholder('—');
     $editor_column['editor'] = array('#markup' => $editor_name);
     $position = array_search('name', array_keys($form['formats'][$format_id])) + 1;
     $start = array_splice($form['formats'][$format_id], 0, $position, $editor_column);
diff --git a/core/modules/editor/lib/Drupal/editor/Tests/EditorSecurityTest.php b/core/modules/editor/lib/Drupal/editor/Tests/EditorSecurityTest.php
index 39670cc..28413f7 100644
--- a/core/modules/editor/lib/Drupal/editor/Tests/EditorSecurityTest.php
+++ b/core/modules/editor/lib/Drupal/editor/Tests/EditorSecurityTest.php
@@ -258,7 +258,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'],
         )));
@@ -377,7 +377,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/lib/Drupal/entity_reference/ConfigurableEntityReferenceItem.php b/core/modules/entity_reference/lib/Drupal/entity_reference/ConfigurableEntityReferenceItem.php
index 550f3d7..a8ddca3 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/ConfigurableEntityReferenceItem.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/ConfigurableEntityReferenceItem.php
@@ -188,7 +188,7 @@ public function instanceSettingsForm(array $form, array &$form_state) {
       // entity type specific plugins (e.g. 'default_node', 'default_user',
       // ...).
       if (in_array($plugin_id, $handler_groups)) {
-        $handlers_options[$plugin_id] = check_plain($plugin['label']);
+        $handlers_options[$plugin_id] = String::checkPlain($plugin['label']);
       }
     }
 
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
index 623140f..d255383 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/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\FieldItemListInterface;
 use Drupal\entity_reference\RecursiveRenderingException;
 
@@ -89,7 +90,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' => $item->entity->getEntityTypeId(), '@entity_id' => $item->target_id)));
+        throw new RecursiveRenderingException(String::format('Recursive rendering detected when rendering entity @entity_type(@entity_id). Aborting rendering.', array('@entity_type' => $item->entity->getEntityTypeId(), '@entity_id' => $item->target_id)));
       }
 
       if (!empty($item->target_id)) {
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceIdFormatter.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceIdFormatter.php
index 6df0d11..41a8995 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceIdFormatter.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceIdFormatter.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\entity_reference\Plugin\Field\FieldFormatter;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldItemListInterface;
 
 /**
@@ -35,7 +36,7 @@ public function viewElements(FieldItemListInterface $items) {
         continue;
       }
       if (!empty($item->entity) && !empty($item->target_id)) {
-        $elements[$delta] = array('#markup' => check_plain($item->target_id));
+        $elements[$delta] = array('#markup' => String::checkPlain($item->target_id));
       }
     }
 
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php
index 7cdac18..8d67c27 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\entity_reference\Plugin\Field\FieldFormatter;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldItemListInterface;
 
 /**
@@ -77,7 +78,7 @@ public function viewElements(FieldItemListInterface $items) {
           ) + $uri->toRenderArray();
         }
         else {
-          $elements[$delta] = array('#markup' => check_plain($label));
+          $elements[$delta] = array('#markup' => String::checkPlain($label));
         }
       }
     }
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php
index 5105a20..e3d1753 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\entity_reference\Plugin\entity_reference\selection;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Database\Query\AlterableInterface;
 use Drupal\Core\Database\Query\SelectInterface;
 use Drupal\Core\Entity\EntityInterface;
@@ -175,7 +176,7 @@ public function getReferenceableEntities($match = NULL, $match_operator = 'CONTA
     $entities = entity_load_multiple($target_type, $result);
     foreach ($entities as $entity_id => $entity) {
       $bundle = $entity->bundle();
-      $options[$bundle][$entity_id] = check_plain($entity->label());
+      $options[$bundle][$entity_id] = String::checkPlain($entity->label());
     }
 
     return $options;
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceFormatterTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceFormatterTest.php
index 44bcca1..65c156e 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceFormatterTest.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceFormatterTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\entity_reference\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\system\Tests\Entity\EntityUnitTestBase;
 
 use Symfony\Component\HttpFoundation\Request;
@@ -89,7 +90,7 @@ public function testAccess() {
       entity_view($entity_2, 'default');
 
       // Verify the un-accessible item still exists.
-      $this->assertEqual($entity_2->{$field_name}->value, $entity_1->id(), format_string('The un-accessible item still exists after @name formatter was executed.', array('@name' => $name)));
+      $this->assertEqual($entity_2->{$field_name}->value, $entity_1->id(), String::format('The un-accessible item still exists after @name formatter was executed.', array('@name' => $name)));
     }
   }
 }
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceIntegrationTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceIntegrationTest.php
index 3a892b2..4d88c72 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceIntegrationTest.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceIntegrationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\entity_reference\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -141,7 +142,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/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php
index 19f5035..c8644ae 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\entity_reference\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Language\Language;
 use Drupal\comment\CommentInterface;
@@ -40,7 +41,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'])) {
@@ -51,7 +52,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)));
       }
     }
   }
@@ -115,7 +116,7 @@ public function testNodeHandler() {
       $node = entity_create('node', $values);
       $node->save();
       $nodes[$key] = $node;
-      $node_labels[$key] = check_plain($node->label());
+      $node_labels[$key] = String::checkPlain($node->label());
     }
 
     // Test as a non-admin.
@@ -262,7 +263,7 @@ public function testUserHandler() {
         $account = $values;
       }
       $users[$key] = $account;
-      $user_labels[$key] = check_plain($account->getUsername());
+      $user_labels[$key] = String::checkPlain($account->getUsername());
     }
 
     // Test as a non-admin.
@@ -442,7 +443,7 @@ public function testCommentHandler() {
       $comment = entity_create('comment', $values);
       $comment->save();
       $comments[$key] = $comment;
-      $comment_labels[$key] = check_plain($comment->label());
+      $comment_labels[$key] = String::checkPlain($comment->label());
     }
 
     // Test as a non-admin.
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionSortTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionSortTest.php
index 06f0a69..669a657 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionSortTest.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionSortTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\entity_reference\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -115,7 +116,7 @@ public function testSort() {
       $node = entity_create('node', $values);
       $node->save();
       $nodes[$key] = $node;
-      $node_labels[$key] = check_plain($node->label());
+      $node_labels[$key] = String::checkPlain($node->label());
     }
 
     // Test as a non-admin.
diff --git a/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php b/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php
index 11c4f0d..a4fae1b 100644
--- a/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php
+++ b/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Config\Entity\ConfigEntityBase;
 use Drupal\Core\Entity\EntityInterface;
@@ -215,13 +216,13 @@ public function __construct(array $values, $entity_type = 'field_config') {
       throw new FieldException('Attempt to create an unnamed field.');
     }
     if (!preg_match('/^[_a-z]+[_a-z0-9]*$/', $values['name'])) {
-      throw new FieldException(format_string('Attempt to create a field @field_name with invalid characters. Only lowercase alphanumeric characters and underscores are allowed, and only lowercase letters and underscore are allowed as the first character', array('@field_name' => $values['name'])));
+      throw new FieldException(String::format('Attempt to create a field @field_name with invalid characters. Only lowercase alphanumeric characters and underscores are allowed, and only lowercase letters and underscore are allowed as the first character', array('@field_name' => $values['name'])));
     }
     if (empty($values['type'])) {
-      throw new FieldException(format_string('Attempt to create field @field_name with no type.', array('@field_name' => $values['name'])));
+      throw new FieldException(String::format('Attempt to create field @field_name with no type.', array('@field_name' => $values['name'])));
     }
     if (empty($values['entity_type'])) {
-      throw new FieldException(format_string('Attempt to create a field @field_name with no entity_type.', array('@field_name' => $values['name'])));
+      throw new FieldException(String::format('Attempt to create a field @field_name with no entity_type.', array('@field_name' => $values['name'])));
     }
 
     parent::__construct($values, $entity_type);
@@ -305,7 +306,7 @@ protected function preSaveNew(EntityStorageInterface $storage) {
     // We use Unicode::strlen() because the DB layer assumes that column widths
     // are given in characters rather than bytes.
     if (Unicode::strlen($this->name) > static::NAME_MAX_LENGTH) {
-      throw new FieldException(format_string(
+      throw new FieldException(String::format(
         'Attempt to create a field with an ID longer than @max characters: %name', array(
           '@max' => static::NAME_MAX_LENGTH,
           '%name' => $this->name,
@@ -316,13 +317,13 @@ protected function preSaveNew(EntityStorageInterface $storage) {
     // Disallow reserved field names.
     $disallowed_field_names = array_keys($entity_manager->getBaseFieldDefinitions($this->entity_type));
     if (in_array($this->name, $disallowed_field_names)) {
-      throw new FieldException(format_string('Attempt to create field %name which is reserved by entity type %type.', array('%name' => $this->name, '%type' => $this->entity_type)));
+      throw new FieldException(String::format('Attempt to create field %name which is reserved by entity type %type.', array('%name' => $this->name, '%type' => $this->entity_type)));
     }
 
     // Check that the field type is known.
     $field_type = $field_type_manager->getDefinition($this->type);
     if (!$field_type) {
-      throw new FieldException(format_string('Attempt to create a field of unknown type %type.', array('%type' => $this->type)));
+      throw new FieldException(String::format('Attempt to create a field of unknown type %type.', array('%type' => $this->type)));
     }
     $this->module = $field_type['provider'];
 
@@ -464,7 +465,7 @@ public function getSchema() {
 
       // Check that the schema does not include forbidden column names.
       if (array_intersect(array_keys($schema['columns']), static::getReservedColumns())) {
-        throw new FieldException(format_string('Illegal field type @field_type on @field_name.', array('@field_type' => $this->type, '@field_name' => $this->name)));
+        throw new FieldException(String::format('Illegal field type @field_type on @field_name.', array('@field_type' => $this->type, '@field_name' => $this->name)));
       }
 
       // Merge custom indexes with those specified by the field type. Custom
diff --git a/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php b/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php
index 3eea9cb..bf9a6c1 100644
--- a/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php
+++ b/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Config\Entity\ConfigEntityBase;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityStorageInterface;
@@ -238,7 +239,7 @@ public function __construct(array $values, $entity_type = 'field_instance_config
     if (isset($values['field_uuid']) && isset($values['uuid'])) {
       $field = Field::fieldInfo()->getFieldById($values['field_uuid']);
       if (!$field) {
-        throw new FieldException(format_string('Attempt to create an instance of unknown field @uuid', array('@uuid' => $values['field_uuid'])));
+        throw new FieldException(String::format('Attempt to create an instance of unknown field @uuid', array('@uuid' => $values['field_uuid'])));
       }
       $values['field_name'] = $field->getName();
     }
@@ -248,7 +249,7 @@ public function __construct(array $values, $entity_type = 'field_instance_config
     elseif (isset($values['field_name']) && isset($values['entity_type'])) {
       $field = Field::fieldInfo()->getField($values['entity_type'], $values['field_name']);
       if (!$field) {
-        throw new FieldException(format_string('Attempt to create an instance of field @field_name that does not exist on entity type @entity_type.', array('@field_name' => $values['field_name'], '@entity_type' => $values['entity_type'])));
+        throw new FieldException(String::format('Attempt to create an instance of field @field_name that does not exist on entity type @entity_type.', array('@field_name' => $values['field_name'], '@entity_type' => $values['entity_type'])));
       }
       $values['field_uuid'] = $field->uuid();
     }
@@ -265,10 +266,10 @@ public function __construct(array $values, $entity_type = 'field_instance_config
 
     // Check required properties.
     if (empty($values['entity_type'])) {
-      throw new FieldException(format_string('Attempt to create an instance of field @field_name without an entity_type.', array('@field_name' => $this->field->name)));
+      throw new FieldException(String::format('Attempt to create an instance of field @field_name without an entity_type.', array('@field_name' => $this->field->name)));
     }
     if (empty($values['bundle'])) {
-      throw new FieldException(format_string('Attempt to create an instance of field @field_name without a bundle.', array('@field_name' => $this->field->name)));
+      throw new FieldException(String::format('Attempt to create an instance of field @field_name without a bundle.', array('@field_name' => $this->field->name)));
     }
 
     // 'Label' defaults to the field name (mostly useful for field instances
diff --git a/core/modules/field/lib/Drupal/field/Plugin/views/argument/FieldList.php b/core/modules/field/lib/Drupal/field/Plugin/views/argument/FieldList.php
index 2f0cadb..689d383 100644
--- a/core/modules/field/lib/Drupal/field/Plugin/views/argument/FieldList.php
+++ b/core/modules/field/lib/Drupal/field/Plugin/views/argument/FieldList.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Plugin\views\argument;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\argument\Numeric;
@@ -68,7 +69,7 @@ public function summaryName($data) {
     }
     // else fallback to the key.
     else {
-      return check_plain($value);
+      return String::checkPlain($value);
     }
   }
 
diff --git a/core/modules/field/lib/Drupal/field/Plugin/views/argument/ListString.php b/core/modules/field/lib/Drupal/field/Plugin/views/argument/ListString.php
index a257cad..162c602 100644
--- a/core/modules/field/lib/Drupal/field/Plugin/views/argument/ListString.php
+++ b/core/modules/field/lib/Drupal/field/Plugin/views/argument/ListString.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Plugin\views\argument;
 
+use Drupal\Component\Utility\String as UtilityString;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\argument\String;
@@ -70,7 +71,7 @@ public function summaryName($data) {
     }
     // else fallback to the key.
     else {
-      return $this->caseTransform(check_plain($value), $this->options['case']);
+      return $this->caseTransform(UtilityString::checkPlain($value), $this->options['case']);
     }
   }
 
diff --git a/core/modules/field/lib/Drupal/field/Tests/DisplayApiTest.php b/core/modules/field/lib/Drupal/field/Tests/DisplayApiTest.php
index 88001f0..765c93d 100644
--- a/core/modules/field/lib/Drupal/field/Tests/DisplayApiTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/DisplayApiTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 
 class DisplayApiTest extends FieldUnitTestBase {
@@ -129,7 +130,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)));
     }
 
     // Check that explicit display settings are used.
@@ -168,7 +169,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
@@ -178,7 +179,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
@@ -188,7 +189,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)));
     }
   }
 
@@ -203,7 +204,7 @@ function testFieldItemView() {
       $item = $this->entity->{$this->field_name}[$delta];
       $output = $item->view();
       $this->content = drupal_render($output);
-      $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.
@@ -218,7 +219,7 @@ function testFieldItemView() {
       $item = $this->entity->{$this->field_name}[$delta];
       $output = $item->view($display);
       $this->content = drupal_render($output);
-      $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.
@@ -233,7 +234,7 @@ function testFieldItemView() {
       $item = $this->entity->{$this->field_name}[$delta];
       $output = $item->view($display);
       $this->content = drupal_render($output);
-      $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 instance are
@@ -243,7 +244,7 @@ function testFieldItemView() {
       $item = $this->entity->{$this->field_name}[$delta];
       $output = $item->view('teaser');
       $this->content = drupal_render($output);
-      $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
@@ -253,7 +254,7 @@ function testFieldItemView() {
       $item = $this->entity->{$this->field_name}[$delta];
       $output = $item->view('unknown_view_mode');
       $this->content = drupal_render($output);
-      $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/lib/Drupal/field/Tests/FieldAttachStorageTest.php b/core/modules/field/lib/Drupal/field/Tests/FieldAttachStorageTest.php
index 4b0e85e..af3db8b 100644
--- a/core/modules/field/lib/Drupal/field/Tests/FieldAttachStorageTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/FieldAttachStorageTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Unit test class for storage-related field behavior.
  */
@@ -78,21 +80,21 @@ function testFieldAttachSaveLoad() {
     $this->assertEqual(count($entity->{$this->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->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->field_name}[$delta]->value , $values[$current_revision][$delta]['value'], String::format('Current revision: expected value %delta was found.', array('%delta' => $delta)));
       // The value added in
       // \Drupal\field_test\Plugin\Field\FieldType\TestItem::getCacheData() is
       // found.
-      $this->assertEqual($entity->{$this->field_name}[$delta]->additional_key, 'additional_value', format_string('Current revision: extra information for value %delta was found', array('%delta' => $delta)));
+      $this->assertEqual($entity->{$this->field_name}[$delta]->additional_key, 'additional_value', String::format('Current revision: extra information for 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->field_name}), $cardinality, format_string('Revision %revision_id: expected number of values.', array('%revision_id' => $revision_id)));
+      $this->assertEqual(count($entity->{$this->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->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->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)));
       }
     }
   }
@@ -163,9 +165,9 @@ function testFieldAttachLoadMultiple() {
       $instances = field_info_instances($entity_type, $bundles[$index]);
       foreach ($instances as $field_name => $instance) {
         // 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)));
         // The value added in hook_field_load() is found.
-        $this->assertEqual($entity->{$field_name}->additional_key, 'additional_value', format_string('Entity %index: extra information was found', array('%index' => $index)));
+        $this->assertEqual($entity->{$field_name}->additional_key, 'additional_value', String::format('Entity %index: extra information was found', array('%index' => $index)));
       }
     }
   }
diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php b/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php
index 4999a83..a9c46c9 100644
--- a/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 
 class FieldInfoTest extends FieldUnitTestBase {
@@ -29,7 +30,7 @@ function testFieldInfo() {
     $entity_type = \Drupal::service('plugin.manager.field.field_type')->getDefinitions();
     foreach ($field_test_info as $t_key => $field_type) {
       foreach ($field_type as $key => $val) {
-        $this->assertEqual($entity_type[$t_key][$key], $val, format_string('Field type %t_key key %key is %value', array('%t_key' => $t_key, '%key' => $key, '%value' => print_r($val, TRUE))));
+        $this->assertEqual($entity_type[$t_key][$key], $val, String::format('Field type %t_key key %key is %value', array('%t_key' => $t_key, '%key' => $key, '%value' => print_r($val, TRUE))));
       }
       $this->assertEqual($entity_type[$t_key]['provider'], 'field_test',  'Field type field_test module appears.');
     }
@@ -37,7 +38,7 @@ function testFieldInfo() {
     // Verify that no unexpected instances exist.
     $instances = field_info_instances('entity_test');
     $expected = array();
-    $this->assertIdentical($instances, $expected, format_string("field_info_instances('entity_test') returns %expected.", array('%expected' => var_export($expected, TRUE))));
+    $this->assertIdentical($instances, $expected, String::format("field_info_instances('entity_test') returns %expected.", array('%expected' => var_export($expected, TRUE))));
     $instances = field_info_instances('entity_test', 'entity_test');
     $this->assertIdentical($instances, array(), "field_info_instances('entity_test', 'entity_test') returns an empty array.");
 
@@ -56,7 +57,7 @@ function testFieldInfo() {
     $this->assertEqual($fields[$field->uuid]->module, 'field_test', 'info fields contains field module');
     $settings = array('test_field_setting' => 'dummy test string');
     foreach ($settings as $key => $val) {
-      $this->assertEqual($fields[$field->uuid]->getSetting($key), $val, format_string('Field setting %key has correct default value %value', array('%key' => $key, '%value' => $val)));
+      $this->assertEqual($fields[$field->uuid]->getSetting($key), $val, String::format('Field setting %key has correct default value %value', array('%key' => $key, '%value' => $val)));
     }
     $this->assertEqual($fields[$field->uuid]->getCardinality(), 1, 'info fields contains cardinality 1');
 
@@ -74,7 +75,7 @@ function testFieldInfo() {
 
     $entity_type = \Drupal::entityManager()->getDefinition('entity_test');
     $instances = field_info_instances('entity_test', $instance->bundle);
-    $this->assertEqual(count($instances), 1, format_string('One instance shows up in info when attached to a bundle on a @label.', array(
+    $this->assertEqual(count($instances), 1, String::format('One instance shows up in info when attached to a bundle on a @label.', array(
       '@label' => $entity_type->getLabel(),
     )));
     $this->assertTrue($instance_definition < $instances[$instance->getName()], 'Instance appears in info correctly');
@@ -94,7 +95,7 @@ function testFieldInfo() {
     // Test with an entity type that has no bundles.
     $instances = field_info_instances('user');
     $expected = array();
-    $this->assertIdentical($instances, $expected, format_string("field_info_instances('user') returns %expected.", array('%expected' => var_export($expected, TRUE))));
+    $this->assertIdentical($instances, $expected, String::format("field_info_instances('user') returns %expected.", array('%expected' => var_export($expected, TRUE))));
     $instances = field_info_instances('user', 'user');
     $this->assertIdentical($instances, array(), "field_info_instances('user', 'user') returns an empty array.");
 
@@ -292,8 +293,8 @@ function testSettingsInfo() {
     $info = $this->getExpectedFieldTypeDefinition();
     foreach ($info as $type => $data) {
       $field_type_manager = \Drupal::service('plugin.manager.field.field_type');
-      $this->assertIdentical($field_type_manager->getDefaultSettings($type), $data['class']::defaultSettings(), format_string("field settings service returns %type's field settings", array('%type' => $type)));
-      $this->assertIdentical($field_type_manager->getDefaultInstanceSettings($type), $data['class']::defaultInstanceSettings(), format_string("field instance settings service returns %type's field instance settings", array('%type' => $type)));
+      $this->assertIdentical($field_type_manager->getDefaultSettings($type), $data['class']::defaultSettings(), String::format("field settings service returns %type's field settings", array('%type' => $type)));
+      $this->assertIdentical($field_type_manager->getDefaultInstanceSettings($type), $data['class']::defaultInstanceSettings(), String::format("field instance settings service returns %type's field instance settings", array('%type' => $type)));
     }
   }
 
diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldTestBase.php b/core/modules/field/lib/Drupal/field/Tests/FieldTestBase.php
index 3f5d2c5..b0a7bfb 100644
--- a/core/modules/field/lib/Drupal/field/Tests/FieldTestBase.php
+++ b/core/modules/field/lib/Drupal/field/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\Language;
 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/lib/Drupal/field/Tests/FieldUnitTestBase.php b/core/modules/field/lib/Drupal/field/Tests/FieldUnitTestBase.php
index cf43966..b67976e 100644
--- a/core/modules/field/lib/Drupal/field/Tests/FieldUnitTestBase.php
+++ b/core/modules/field/lib/Drupal/field/Tests/FieldUnitTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Language\Language;
 use Drupal\simpletest\DrupalUnitTestBase;
@@ -158,7 +159,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)));
     }
   }
 
@@ -169,8 +170,9 @@ function assertFieldValues(EntityInterface $entity, $field_name, $expected_value
    *   Raw (HTML) string to look 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 \Drupal\Component\Utility\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
@@ -195,8 +197,9 @@ protected function assertRaw($raw, $message = '', $group = 'Other') {
    *   Raw (HTML) string to look 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 \Drupal\Component\Utility\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
@@ -220,8 +223,9 @@ protected function assertNoRaw($raw, $message = '', $group = 'Other') {
    *   Text to look 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 \Drupal\Component\Utility\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
@@ -245,8 +249,9 @@ protected function assertText($text, $message = '', $group = 'Other') {
    *   Text to look 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 \Drupal\Component\Utility\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
diff --git a/core/modules/field/lib/Drupal/field/Tests/FormTest.php b/core/modules/field/lib/Drupal/field/Tests/FormTest.php
index bbfccb7..b26af01 100644
--- a/core/modules/field/lib/Drupal/field/Tests/FormTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/FormTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldDefinitionInterface;
 
 class FormTest extends FieldTestBase {
@@ -104,7 +105,7 @@ function testFieldFormSingle() {
     $this->drupalGet('entity_test/add');
 
     // Create token value expected for description.
-    $token_description = check_plain(\Drupal::config('system.site')->get('name')) . '_description';
+    $token_description = String::checkPlain(\Drupal::config('system.site')->get('name')) . '_description';
     $this->assertText($token_description, 'Token replacement for description is displayed');
     $this->assertFieldByName("{$field_name}[0][value]", '', 'Widget is displayed');
     $this->assertNoField("{$field_name}[1][value]", 'No extraneous widget is displayed');
diff --git a/core/modules/field/lib/Drupal/field/Tests/TranslationTest.php b/core/modules/field/lib/Drupal/field/Tests/TranslationTest.php
index 02630bb..16a4e36 100644
--- a/core/modules/field/lib/Drupal/field/Tests/TranslationTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/TranslationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 
 /**
@@ -142,7 +143,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.
@@ -177,7 +178,7 @@ function testTranslatableFieldSaveLoad() {
     // @todo Test every translation once the Entity Translation API allows for
     //   multilingual defaults.
     $langcode = $entity->language()->id;
-    $this->assertEqual($entity->getTranslation($langcode)->{$field_name_default}->getValue(), $instance->default_value, format_string('Default value correctly populated for language %language.', array('%language' => $langcode)));
+    $this->assertEqual($entity->getTranslation($langcode)->{$field_name_default}->getValue(), $instance->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) {
@@ -191,7 +192,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/lib/Drupal/field/Tests/TranslationWebTest.php b/core/modules/field/lib/Drupal/field/Tests/TranslationWebTest.php
index d8d9f9c..69357f9 100644
--- a/core/modules/field/lib/Drupal/field/Tests/TranslationWebTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/TranslationWebTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 
 /**
@@ -137,7 +138,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/lib/Drupal/field_ui/DisplayOverviewBase.php b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverviewBase.php
index 2deca15..dd2290f 100644
--- a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverviewBase.php
+++ b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverviewBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field_ui;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Plugin\PluginManagerBase;
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Entity\Display\EntityDisplayInterface;
@@ -271,7 +272,7 @@ protected function buildFieldRow(FieldDefinitionInterface $field_definition, Ent
         'defaultPlugin' => $this->getDefaultPlugin($field_definition->getType()),
       ),
       'human_name' => array(
-        '#markup' => check_plain($label),
+        '#markup' => String::checkPlain($label),
       ),
       'weight' => array(
         '#type' => 'textfield',
diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php
index 01c65ed..2d2d3f1 100644
--- a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php
+++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field_ui;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Field\FieldTypePluginManagerInterface;
@@ -131,7 +132,7 @@ public function buildForm(array $form, array &$form_state, $entity_type_id = NUL
           'id' => drupal_html_class($name),
         ),
         'label' => array(
-          '#markup' => check_plain($instance->getLabel()),
+          '#markup' => String::checkPlain($instance->getLabel()),
         ),
         'field_name' => array(
           '#markup' => $instance->getName(),
diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php
index 979d68b..123455d 100644
--- a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php
+++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php
@@ -98,13 +98,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)));
     }
   }
 
@@ -274,7 +274,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)));
   }
 
   /**
@@ -473,7 +473,7 @@ function testHiddenFields() {
     entity_get_form_display('node', $this->type, 'default')
       ->setComponent($field_name)
       ->save();
-    $this->assertTrue(entity_load('field_instance_config', 'node.' . $this->type . '.' . $field_name), format_string('An instance of the field %field was created programmatically.', array('%field' => $field_name)));
+    $this->assertTrue(entity_load('field_instance_config', 'node.' . $this->type . '.' . $field_name), String::format('An instance of the field %field was created programmatically.', array('%field' => $field_name)));
 
     // Check that the newly added instance appears on the 'Manage Fields'
     // screen.
diff --git a/core/modules/file/file.field.inc b/core/modules/file/file.field.inc
index 7d106ae..12e44e7 100644
--- a/core/modules/file/file.field.inc
+++ b/core/modules/file/file.field.inc
@@ -5,6 +5,7 @@
  * Field module functionality for the File module.
  */
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Html;
 use Drupal\field\FieldConfigInterface;
 
@@ -187,7 +188,7 @@ function theme_file_upload_help($variables) {
     $descriptions[] = t('!size limit.', array('!size' => format_size($upload_validators['file_validate_size'][0])));
   }
   if (isset($upload_validators['file_validate_extensions'])) {
-    $descriptions[] = t('Allowed types: !extensions.', array('!extensions' => check_plain($upload_validators['file_validate_extensions'][0])));
+    $descriptions[] = t('Allowed types: !extensions.', array('!extensions' => String::checkPlain($upload_validators['file_validate_extensions'][0])));
   }
 
   if (isset($upload_validators['file_validate_image_resolution'])) {
diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index 3843be9..d7eba5f 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -5,6 +5,7 @@
  * Defines a "managed_file" Form API field and a "file" field for Field module.
  */
 
+use Drupal\Component\Utility\String;
 use Drupal\file\Entity\File;
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Component\Utility\Unicode;
@@ -1018,15 +1019,15 @@ function file_tokens($type, $tokens, array $data = array(), array $options = arr
 
         // Essential file data
         case 'name':
-          $replacements[$original] = $sanitize ? check_plain($file->getFilename()) : $file->getFilename();
+          $replacements[$original] = $sanitize ? String::checkPlain($file->getFilename()) : $file->getFilename();
           break;
 
         case 'path':
-          $replacements[$original] = $sanitize ? check_plain($file->getFileUri()) : $file->getFileUri();
+          $replacements[$original] = $sanitize ? String::checkPlain($file->getFileUri()) : $file->getFileUri();
           break;
 
         case 'mime':
-          $replacements[$original] = $sanitize ? check_plain($file->getMimeType()) : $file->getMimeType();
+          $replacements[$original] = $sanitize ? String::checkPlain($file->getMimeType()) : $file->getMimeType();
           break;
 
         case 'size':
@@ -1034,7 +1035,7 @@ function file_tokens($type, $tokens, array $data = array(), array $options = arr
           break;
 
         case 'url':
-          $replacements[$original] = $sanitize ? check_plain(file_create_url($file->getFileUri())) : file_create_url($file->getFileUri());
+          $replacements[$original] = $sanitize ? String::checkPlain(file_create_url($file->getFileUri())) : file_create_url($file->getFileUri());
           break;
 
         // These tokens are default variations on the chained tokens handled below.
@@ -1048,7 +1049,7 @@ function file_tokens($type, $tokens, array $data = array(), array $options = arr
 
         case 'owner':
           $name = $file->getOwner()->label();
-          $replacements[$original] = $sanitize ? check_plain($name) : $name;
+          $replacements[$original] = $sanitize ? String::checkPlain($name) : $name;
           break;
       }
     }
@@ -1596,7 +1597,7 @@ function theme_file_link($variables) {
   }
   else {
     $link_text = $variables['description'];
-    $options['attributes']['title'] = check_plain($file->getFilename());
+    $options['attributes']['title'] = String::checkPlain($file->getFilename());
   }
 
   $file_icon = array(
@@ -1624,7 +1625,7 @@ function theme_file_icon($variables) {
   $file = $variables['file'];
   $icon_directory = $variables['icon_directory'];
 
-  $mime = check_plain($file->getMimeType());
+  $mime = String::checkPlain($file->getMimeType());
   $icon_url = file_icon_url($file, $icon_directory);
   return '<img class="file-icon" alt="" title="' . $mime . '" src="' . $icon_url . '" />';
 }
diff --git a/core/modules/file/lib/Drupal/file/Plugin/Field/FieldWidget/FileWidget.php b/core/modules/file/lib/Drupal/file/Plugin/Field/FieldWidget/FileWidget.php
index 460b95e..f8925ae 100644
--- a/core/modules/file/lib/Drupal/file/Plugin/Field/FieldWidget/FileWidget.php
+++ b/core/modules/file/lib/Drupal/file/Plugin/Field/FieldWidget/FileWidget.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\file\Plugin\Field\FieldWidget;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\WidgetBase;
 use Drupal\Core\Field\FieldItemListInterface;
@@ -94,7 +95,7 @@ protected function formMultipleElements(FieldItemListInterface $items, array &$f
         break;
     }
 
-    $title = check_plain($this->fieldDefinition->getLabel());
+    $title = String::checkPlain($this->fieldDefinition->getLabel());
     $description = field_filter_xss($this->fieldDefinition->getDescription());
 
     $elements = array();
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php
index 219c083..6393306 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldDisplayTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\file\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldDefinitionInterface;
 
 /**
@@ -51,7 +52,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/lib/Drupal/file/Tests/FileFieldPathTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldPathTest.php
index 3366b2b..8cb09d2 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldPathTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldPathTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\file\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 
 /**
@@ -36,7 +37,7 @@ function testUploadPath() {
     // Check that the file was uploaded to the file root.
     $node = node_load($nid, TRUE);
     $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'));
@@ -47,7 +48,7 @@ function testUploadPath() {
     // Check that the file was uploaded into the subdirectory.
     $node = node_load($nid, TRUE);
     $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.
@@ -63,7 +64,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/lib/Drupal/file/Tests/FileFieldTestBase.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php
index a7df01d..c60f9c9 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\file\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\file\FileInterface;
 use Drupal\simpletest\WebTestBase;
 
@@ -201,7 +202,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);
   }
 
@@ -211,7 +212,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);
   }
 
@@ -219,7 +220,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);
   }
 
@@ -228,7 +229,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);
   }
 
@@ -236,7 +237,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/lib/Drupal/file/Tests/FileFieldValidateTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php
index b85b187..c04ad56 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldValidateTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\file\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\field\Field;
 
@@ -44,7 +45,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 = node_load($nid, TRUE);
 
@@ -96,13 +97,13 @@ function testFileMaxSize() {
       $nid = $this->uploadNodeFile($small_file, $field_name, $type_name);
       $node = node_load($nid, TRUE);
       $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.
@@ -112,8 +113,8 @@ function testFileMaxSize() {
     $nid = $this->uploadNodeFile($large_file, $field_name, $type_name);
     $node = node_load($nid, TRUE);
     $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/lib/Drupal/file/Tests/FileFieldWidgetTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php
index bf80c17..60c687a 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\file\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Tests file field widget.
  */
@@ -134,7 +136,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;
@@ -176,17 +178,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->randomName()), t('Save and publish'));
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileManagedTestBase.php b/core/modules/file/lib/Drupal/file/Tests/FileManagedTestBase.php
index c777691..d0cfb47 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileManagedTestBase.php
+++ b/core/modules/file/lib/Drupal/file/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/lib/Drupal/file/Tests/FileManagedUnitTestBase.php b/core/modules/file/lib/Drupal/file/Tests/FileManagedUnitTestBase.php
index c9ec86d..481b25a 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileManagedUnitTestBase.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileManagedUnitTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\file\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\file\FileInterface;
 use Drupal\simpletest\DrupalUnitTestBase;
 
@@ -57,16 +58,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.');
@@ -88,13 +89,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/lib/Drupal/file/Tests/FileTokenReplaceTest.php b/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
index 35bb593..9e2b42d 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\file\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 
 /**
@@ -48,16 +49,16 @@ function testFileTokenReplacement() {
     // Generate and test sanitized tokens.
     $tests = array();
     $tests['[file:fid]'] = $file->id();
-    $tests['[file:name]'] = check_plain($file->getFilename());
-    $tests['[file:path]'] = check_plain($file->getFileUri());
-    $tests['[file:mime]'] = check_plain($file->getMimeType());
+    $tests['[file:name]'] = String::checkPlain($file->getFilename());
+    $tests['[file:path]'] = String::checkPlain($file->getFileUri());
+    $tests['[file:mime]'] = String::checkPlain($file->getMimeType());
     $tests['[file:size]'] = format_size($file->getSize());
-    $tests['[file:url]'] = check_plain(file_create_url($file->getFileUri()));
+    $tests['[file:url]'] = String::checkPlain(file_create_url($file->getFileUri()));
     $tests['[file:created]'] = format_date($file->getCreatedTime(), 'medium', '', NULL, $language_interface->id);
     $tests['[file:created:short]'] = format_date($file->getCreatedTime(), 'short', '', NULL, $language_interface->id);
     $tests['[file:changed]'] = format_date($file->getChangedTime(), 'medium', '', NULL, $language_interface->id);
     $tests['[file:changed:short]'] = format_date($file->getChangedTime(), 'short', '', NULL, $language_interface->id);
-    $tests['[file:owner]'] = check_plain(user_format_name($this->admin_user));
+    $tests['[file:owner]'] = String::checkPlain(user_format_name($this->admin_user));
     $tests['[file:owner:uid]'] = $file->getOwnerId();
 
     // Test to make sure that we generated something for each token.
@@ -65,7 +66,7 @@ function testFileTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('file' => $file), array('langcode' => $language_interface->id));
-      $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.
@@ -76,7 +77,7 @@ function testFileTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('file' => $file), array('langcode' => $language_interface->id, '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/lib/Drupal/file/Tests/MoveTest.php b/core/modules/file/lib/Drupal/file/Tests/MoveTest.php
index b063afa..04415a9 100644
--- a/core/modules/file/lib/Drupal/file/Tests/MoveTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/MoveTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\file\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Move related tests
  */
@@ -40,7 +42,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/filter.module b/core/modules/filter/filter.module
index 475bdbb..5c13ef2 100644
--- a/core/modules/filter/filter.module
+++ b/core/modules/filter/filter.module
@@ -887,8 +887,8 @@ function _filter_url_parse_full_links($match) {
   $i = 1;
 
   $match[$i] = decode_entities($match[$i]);
-  $caption = check_plain(_filter_url_trim($match[$i]));
-  $match[$i] = check_plain($match[$i]);
+  $caption = String::checkPlain(_filter_url_trim($match[$i]));
+  $match[$i] = String::checkPlain($match[$i]);
   return '<a href="' . $match[$i] . '">' . $caption . '</a>';
 }
 
@@ -902,8 +902,8 @@ function _filter_url_parse_email_links($match) {
   $i = 0;
 
   $match[$i] = decode_entities($match[$i]);
-  $caption = check_plain(_filter_url_trim($match[$i]));
-  $match[$i] = check_plain($match[$i]);
+  $caption = String::checkPlain(_filter_url_trim($match[$i]));
+  $match[$i] = String::checkPlain($match[$i]);
   return '<a href="mailto:' . $match[$i] . '">' . $caption . '</a>';
 }
 
@@ -917,8 +917,8 @@ function _filter_url_parse_partial_links($match) {
   $i = 1;
 
   $match[$i] = decode_entities($match[$i]);
-  $caption = check_plain(_filter_url_trim($match[$i]));
-  $match[$i] = check_plain($match[$i]);
+  $caption = String::checkPlain(_filter_url_trim($match[$i]));
+  $match[$i] = String::checkPlain($match[$i]);
   return '<a href="http://' . $match[$i] . '">' . $caption . '</a>';
 }
 
@@ -1050,7 +1050,7 @@ function _filter_autop($text) {
  * Escapes all HTML tags, so they will be visible instead of being effective.
  */
 function _filter_html_escape($text) {
-  return trim(check_plain($text));
+  return trim(String::checkPlain($text));
 }
 
 /**
diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php b/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php
index 109d943..54d469f 100644
--- a/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php
+++ b/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\filter\Plugin\Filter;
 
+use Drupal\Component\Utility\String;
 use Drupal\filter\Plugin\FilterBase;
 
 /**
@@ -99,7 +100,7 @@ public function tips($long = FALSE) {
     $output .= '<p>' . $this->t('This site allows HTML content. While learning all of HTML may feel intimidating, learning how to use a very small number of the most basic HTML "tags" is very easy. This table provides examples for each tag that is enabled on this site.') . '</p>';
     $output .= '<p>' . $this->t('For more information see W3C\'s <a href="@html-specifications">HTML Specifications</a> or use your favorite search engine to find other sites that explain HTML.', array('@html-specifications' => 'http://www.w3.org/TR/html/')) . '</p>';
     $tips = array(
-      'a' => array($this->t('Anchors are used to make links to other pages.'), '<a href="' . $base_url . '">' . check_plain(\Drupal::config('system.site')->get('name')) . '</a>'),
+      'a' => array($this->t('Anchors are used to make links to other pages.'), '<a href="' . $base_url . '">' . String::checkPlain(\Drupal::config('system.site')->get('name')) . '</a>'),
       'br' => array($this->t('By default line break tags are automatically added, so use this tag to add additional ones. Use of this tag is different because it is not used with an open/close pair like all the others. Use the extra " /" inside the tag to maintain XHTML 1.0 compatibility'), $this->t('Text with <br />line break')),
       'p' => array($this->t('By default paragraph tags are automatically added, so use this tag to add additional ones.'), '<p>' . $this->t('Paragraph one.') . '</p> <p>' . $this->t('Paragraph two.') . '</p>'),
       'strong' => array($this->t('Strong', array(), array('context' => 'Font weight')), '<strong>' . $this->t('Strong', array(), array('context' => 'Font weight')) . '</strong>'),
@@ -141,7 +142,7 @@ public function tips($long = FALSE) {
       if (!empty($tips[$tag])) {
         $rows[] = array(
           array('data' => $tips[$tag][0], 'class' => array('description')),
-          array('data' => '<code>' . check_plain($tips[$tag][1]) . '</code>', 'class' => array('type')),
+          array('data' => '<code>' . String::checkPlain($tips[$tag][1]) . '</code>', 'class' => array('type')),
           array('data' => $tips[$tag][1], 'class' => array('get'))
         );
       }
@@ -172,7 +173,7 @@ public function tips($long = FALSE) {
     foreach ($entities as $entity) {
       $rows[] = array(
         array('data' => $entity[0], 'class' => array('description')),
-        array('data' => '<code>' . check_plain($entity[1]) . '</code>', 'class' => array('type')),
+        array('data' => '<code>' . String::checkPlain($entity[1]) . '</code>', 'class' => array('type')),
         array('data' => $entity[1], 'class' => array('get'))
       );
     }
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterAPITest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterAPITest.php
index 216545a..15a57d4 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterAPITest.php
+++ b/core/modules/filter/lib/Drupal/filter/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\AllowedValuesInterface;
 use Drupal\Core\TypedData\DataDefinition;
@@ -276,6 +277,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/lib/Drupal/filter/Tests/FilterAdminTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php
index 248a9dd..d1fc5b5 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\filter\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -82,7 +83,7 @@ function testFormatAdmin() {
     $edit_link = $this->xpath('//a[@href=:href]', array(
       ':href' => url('admin/config/content/formats/manage/' . $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);
@@ -254,7 +255,7 @@ function testFilterAdmin() {
     $edit['body[0][format]'] = $plain;
     $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
     $this->drupalGet('node/' . $node->id());
-    $this->assertText(check_plain($text), 'The "Plain text" text format escapes all HTML tags.');
+    $this->assertText(String::checkPlain($text), 'The "Plain text" text format escapes all HTML tags.');
     \Drupal::config('filter.settings')
       ->set('always_show_fallback_choice', FALSE)
       ->save();
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterCrudTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterCrudTest.php
index 8320336..899ef18 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterCrudTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterCrudTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\filter\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\DrupalUnitTestBase;
 
 /**
@@ -87,12 +88,12 @@ 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->cache, $format->cache, format_string('filter_format_load: Proper cache indicator 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->cache, $format->cache, String::format('filter_format_load: Proper cache indicator 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->langcode, $default_langcode, format_string('filter_format_load: Proper language code for text format %format.', $t_args));
+    $this->assertEqual($format->langcode, $default_langcode, String::format('filter_format_load: Proper language code for text format %format.', $t_args));
 
     // Verify the 'cache' text format property according to enabled filters.
     $cacheable = TRUE;
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterHtmlImageSecureTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterHtmlImageSecureTest.php
index bc6d8bb..59aabdc 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterHtmlImageSecureTest.php
+++ b/core/modules/filter/lib/Drupal/filter/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;
 
@@ -150,7 +151,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/lib/Drupal/filter/Tests/FilterSettingsTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterSettingsTest.php
index a11db5d..87835ed 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterSettingsTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterSettingsTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\filter\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\DrupalUnitTestBase;
 
 /**
@@ -48,7 +49,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,
@@ -63,7 +64,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/lib/Drupal/filter/Tests/FilterUnitTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php
index a51d6b9..ea4720d 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\filter\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Html;
 use Drupal\simpletest\DrupalUnitTestBase;
 use Drupal\filter\FilterBag;
@@ -326,7 +327,7 @@ function testNoFollowFilter() {
   /**
    * Tests the HTML escaping filter.
    *
-   * check_plain() is not tested here.
+   * \Drupal\Component\Utility\String::checkPlain() is not tested here.
    */
   function testHtmlEscapeFilter() {
     // Get FilterHtmlEscape object.
@@ -680,22 +681,22 @@ 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.', array(
+          $success = $this->assertTrue(strpos($result, $value) !== FALSE, String::format('@source: @value found.', array(
             '@source' => var_export($source, TRUE),
             '@value' => var_export($value, TRUE),
           )));
         }
         else {
-          $success = $this->assertTrue(strpos($result, $value) === FALSE, format_string('@source: @value not found.', array(
+          $success = $this->assertTrue(strpos($result, $value) === FALSE, String::format('@source: @value not found.', array(
             '@source' => var_export($source, TRUE),
             '@value' => var_export($value, TRUE),
           )));
         }
         if (!$success) {
-          $this->verbose('Source:<pre>' . check_plain(var_export($source, TRUE)) . '</pre>'
-            . '<hr />' . 'Result:<pre>' . check_plain(var_export($result, TRUE)) . '</pre>'
+          $this->verbose('Source:<pre>' . String::checkPlain(var_export($source, TRUE)) . '</pre>'
+            . '<hr />' . 'Result:<pre>' . String::checkPlain(var_export($result, TRUE)) . '</pre>'
             . '<hr />' . ($is_expected ? 'Expected:' : 'Not expected:')
-            . '<pre>' . check_plain(var_export($value, TRUE)) . '</pre>'
+            . '<pre>' . String::checkPlain(var_export($value, TRUE)) . '</pre>'
           );
         }
       }
@@ -868,7 +869,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>
@@ -887,7 +888,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>
@@ -904,7 +905,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>
@@ -921,7 +922,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/forum/lib/Drupal/forum/Tests/ForumBlockTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php
index 3799288..6285c63 100644
--- a/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php
+++ b/core/modules/forum/lib/Drupal/forum/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;
 
@@ -67,7 +68,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.
@@ -79,10 +80,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])));
       }
     }
   }
@@ -125,10 +126,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/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
index c7d8b64..7b2a058 100644
--- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
+++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\forum\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\simpletest\WebTestBase;
 
@@ -383,7 +384,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.
@@ -510,7 +511,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/lib/Drupal/help/Tests/HelpTest.php b/core/modules/help/lib/Drupal/help/Tests/HelpTest.php
index dd21f0e..f042fe2 100644
--- a/core/modules/help/lib/Drupal/help/Tests/HelpTest.php
+++ b/core/modules/help/lib/Drupal/help/Tests/HelpTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\help\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -77,7 +78,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)));
     }
   }
 
@@ -93,8 +94,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/lib/Drupal/image/Tests/ImageAdminStylesTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php
index 9837196..2acf35a 100644
--- a/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php
+++ b/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\image\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\image\ImageStyleInterface;
 
 /**
@@ -60,7 +61,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)));
   }
 
   /**
@@ -142,13 +143,13 @@ function testStyle() {
       $uuids[$effect->getPluginId()] = $uuid;
       $this->drupalGet($style_path . '/effects/' . $uuid);
       foreach ($effect_edits[$effect->getPluginId()] as $field => $value) {
-        $this->assertFieldByName($field, $value, format_string('The %field field in the %effect effect has the correct value of %value.', array('%field' => $field, '%effect' => $effect->getPluginId(), '%value' => $value)));
+        $this->assertFieldByName($field, $value, String::format('The %field field in the %effect effect has the correct value of %value.', array('%field' => $field, '%effect' => $effect->getPluginId(), '%value' => $value)));
       }
     }
 
     // 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,
@@ -187,7 +188,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'));
 
@@ -197,12 +198,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);
@@ -223,7 +224,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'));
@@ -236,7 +237,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'],
@@ -250,9 +251,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())));
 
   }
 
@@ -288,7 +289,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->randomName(10));
@@ -298,7 +299,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.
@@ -422,7 +423,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/lib/Drupal/image/Tests/ImageFieldDefaultImagesTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDefaultImagesTest.php
index edf1919..f1de880 100644
--- a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDefaultImagesTest.php
+++ b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDefaultImagesTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\image\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Tests default image settings.
  */
@@ -120,7 +122,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 default equals expected file ID of @fid.',
         array('@fid' => $default_images['field']->id())
       )
@@ -130,7 +132,7 @@ public function testDefaultImages() {
     $this->assertFieldByXpath(
       '//input[@name="instance[settings][default_image][fid][fids]"]',
       $default_images['instance']->id(),
-      format_string(
+      String::format(
         'Article image field instance default equals expected file ID of @fid.',
         array('@fid' => $default_images['instance']->id())
       )
@@ -141,7 +143,7 @@ public function testDefaultImages() {
     $this->assertFieldByXpath(
       '//input[@name="field[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())
       )
@@ -152,7 +154,7 @@ public function testDefaultImages() {
     $this->assertFieldByXpath(
       '//input[@name="instance[settings][default_image][fid][fids]"]',
       $default_images['instance2']->id(),
-      format_string(
+      String::format(
         'Page image field instance default equals expected file ID of @fid.',
         array('@fid' => $default_images['instance2']->id())
       )
@@ -164,7 +166,7 @@ public function testDefaultImages() {
     $this->assertEqual(
       $article_built[$field_name]['#items'][0]->target_id,
       $default_images['instance']->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['instance']->id())
       )
@@ -176,7 +178,7 @@ public function testDefaultImages() {
     $this->assertEqual(
       $page_built[$field_name]['#items'][0]->target_id,
       $default_images['instance2']->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['instance2']->id())
       )
@@ -191,7 +193,7 @@ public function testDefaultImages() {
     $this->assertFieldByXpath(
       '//input[@name="field[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())
       )
@@ -203,7 +205,7 @@ public function testDefaultImages() {
     $this->assertEqual(
       $article_built[$field_name]['#items'][0]->target_id,
       $default_images['instance']->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['instance']->id())
       )
@@ -211,7 +213,7 @@ public function testDefaultImages() {
     $this->assertEqual(
       $page_built[$field_name]['#items'][0]->target_id,
       $default_images['instance2']->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['instance2']->id())
       )
@@ -227,7 +229,7 @@ public function testDefaultImages() {
     $this->assertFieldByXpath(
       '//input[@name="instance[settings][default_image][fid][fids]"]',
       $default_images['instance_new']->id(),
-      format_string(
+      String::format(
         'Updated article image field instance default equals expected file ID of @fid.',
         array('@fid' => $default_images['instance_new']->id())
       )
@@ -241,7 +243,7 @@ public function testDefaultImages() {
     $this->assertEqual(
       $article_built[$field_name]['#items'][0]->target_id,
       $default_images['instance_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['instance_new']->id())
       )
@@ -250,7 +252,7 @@ public function testDefaultImages() {
     $this->assertEqual(
       $page_built[$field_name]['#items'][0]->target_id,
       $default_images['instance2']->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['instance2']->id())
       )
@@ -275,7 +277,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 +286,7 @@ public function testDefaultImages() {
     $this->assertEqual(
       $page_built[$field_name]['#items'][0]->target_id,
       $default_images['instance2']->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['instance2']->id())
       )
diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php
index c8f205f..ae37297 100644
--- a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php
+++ b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\image\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldDefinitionInterface;
 
 /**
@@ -235,7 +236,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())));
   }
 
   /**
diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageStyleFlushTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageStyleFlushTest.php
index 1cbe4e8..64254f6 100644
--- a/core/modules/image/lib/Drupal/image/Tests/ImageStyleFlushTest.php
+++ b/core/modules/image/lib/Drupal/image/Tests/ImageStyleFlushTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\image\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Tests flushing of image styles.
  */
@@ -91,11 +93,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.
@@ -110,9 +112,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/lib/Drupal/language/Tests/LanguageBrowserDetectionUnitTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageBrowserDetectionUnitTest.php
index 5571668..f5f2941 100644
--- a/core/modules/language/lib/Drupal/language/Tests/LanguageBrowserDetectionUnitTest.php
+++ b/core/modules/language/lib/Drupal/language/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;
@@ -158,7 +159,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/lib/Drupal/language/Tests/LanguageConfigurationTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationTest.php
index 6093263..4cb0cbf 100644
--- a/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationTest.php
+++ b/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\language\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 use Drupal\simpletest\WebTestBase;
 
@@ -162,7 +163,7 @@ protected function checkConfigurableLanguageWeight($state = 'by default') {
     $replacements = array('@event' => $state);
     foreach (\Drupal::languageManager()->getLanguages(Language::STATE_LOCKED) as $locked_language) {
       $replacements['%language'] = $locked_language->name;
-      $this->assertTrue($locked_language->weight > $max_configurable_language_weight, format_string('System language %language has higher weight than configurable languages @event', $replacements));
+      $this->assertTrue($locked_language->weight > $max_configurable_language_weight, String::format('System language %language has higher weight than configurable languages @event', $replacements));
     }
   }
 
diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageDependencyInjectionTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageDependencyInjectionTest.php
index f734210..cb16967 100644
--- a/core/modules/language/lib/Drupal/language/Tests/LanguageDependencyInjectionTest.php
+++ b/core/modules/language/lib/Drupal/language/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\Exception\DeleteDefaultLanguageException;
@@ -36,7 +37,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/lib/Drupal/language/Tests/LanguageNegotiationInfoTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageNegotiationInfoTest.php
index 70d297c..bfd5bad 100644
--- a/core/modules/language/lib/Drupal/language/Tests/LanguageNegotiationInfoTest.php
+++ b/core/modules/language/lib/Drupal/language/Tests/LanguageNegotiationInfoTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\language\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUI;
 use Drupal\simpletest\WebTestBase;
@@ -126,10 +127,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)));
       }
     }
 
@@ -139,7 +140,7 @@ function testInfoAlterations() {
     foreach ($this->languageManager()->getDefinedLanguageTypes() as $type) {
       $langcode = $last[$type];
       $value = $type == Language::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
@@ -149,7 +150,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
@@ -179,7 +180,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/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php
index 89832f3..d755ce9 100644
--- a/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php
+++ b/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\language\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationBrowser;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationSelected;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl;
@@ -442,7 +443,7 @@ function testLanguageDomain() {
     $italian_url = url('admin', array('language' => $languages['it'], 'script' => ''));
     $url_scheme = $this->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);
@@ -450,7 +451,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.
@@ -459,6 +460,6 @@ function testLanguageDomain() {
     $generator->setRequest($request);
     $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/lib/Drupal/locale/StringBase.php b/core/modules/locale/lib/Drupal/locale/StringBase.php
index 81544f0..698d872 100644
--- a/core/modules/locale/lib/Drupal/locale/StringBase.php
+++ b/core/modules/locale/lib/Drupal/locale/StringBase.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\locale;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Defines the locale string base class.
  *
@@ -188,7 +190,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 +206,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/lib/Drupal/locale/StringDatabaseStorage.php b/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php
index fe87ef6..bf4a2f1 100644
--- a/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php
+++ b/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\locale;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\Connection;
 
@@ -201,7 +202,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()
       )));
     }
@@ -478,7 +479,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()
       )));
     }
@@ -511,7 +512,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/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php
index d822f10..27a55a9 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\locale\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -294,7 +295,7 @@ 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])));
     }
 
     $locale_config = $this->container->get('locale.config.typed');
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php
index 59993f0..41ae170 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\locale\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 use Drupal\locale\SourceString;
 use Drupal\locale\TranslationString;
@@ -60,7 +61,7 @@ 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/lib/Drupal/locale/Tests/LocaleUpdateBase.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateBase.php
index 2e29d98..897b559 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateBase.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateBase.php
@@ -291,6 +291,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/lib/Drupal/locale/Tests/LocaleUpdateTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php
index 81a1ac6..97649e7 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\locale\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -57,7 +58,7 @@ 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/lib/Drupal/menu/Tests/MenuTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
index a95f25f..fffca79 100644
--- a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
+++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\menu\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Json;
 
 /**
@@ -469,7 +470,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/lib/Drupal/node/Plugin/Search/NodeSearch.php b/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php
index 443c5cb..7132f76 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Plugin\Search;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Config\Config;
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Database\Query\SelectExtender;
@@ -254,7 +255,7 @@ public function execute() {
       );
       $results[] = array(
         'link' => $node->url('canonical', array('absolute' => TRUE, 'language' => $language)),
-        'type' => check_plain($this->entityManager->getStorage('node_type')->load($node->bundle())->label()),
+        'type' => String::checkPlain($this->entityManager->getStorage('node_type')->load($node->bundle())->label()),
         'title' => $node->label(),
         'user' => drupal_render($username),
         'date' => $node->getChangedTime(),
@@ -339,7 +340,7 @@ protected function indexNode(NodeInterface $node) {
       unset($build['#theme']);
       $node->rendered = drupal_render($build);
 
-      $text = '<h1>' . check_plain($node->label($language->id)) . '</h1>' . $node->rendered;
+      $text = '<h1>' . String::checkPlain($node->label($language->id)) . '</h1>' . $node->rendered;
 
       // Fetch extra data normally not visible.
       $extra = $this->moduleHandler->invokeAll('node_update_index', array($node, $language->id));
@@ -410,7 +411,7 @@ public function searchFormAlter(array &$form, array &$form_state) {
     );
 
     // Add node types.
-    $types = array_map('check_plain', node_type_get_names());
+    $types = array_map('String::checkPlain', node_type_get_names());
     $form['advanced']['types-fieldset'] = array(
       '#type' => 'fieldset',
       '#title' => t('Types'),
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/argument/Nid.php b/core/modules/node/lib/Drupal/node/Plugin/views/argument/Nid.php
index 82bd934..06ea25d 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/views/argument/Nid.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/views/argument/Nid.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Plugin\views\argument;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Plugin\views\argument\Numeric;
 
 /**
@@ -24,7 +25,7 @@ public function titleQuery() {
 
     $nodes = node_load_multiple($this->value);
     foreach ($nodes as $node) {
-      $titles[] = check_plain($node->label());
+      $titles[] = String::checkPlain($node->label());
     }
     return $titles;
   }
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/argument/Type.php b/core/modules/node/lib/Drupal/node/Plugin/views/argument/Type.php
index 1f38cc1..42a14a6 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/views/argument/Type.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/views/argument/Type.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Plugin\views\argument;
 
+use Drupal\Component\Utility\String as UtilityString;
 use Drupal\views\Plugin\views\argument\String;
 
 /**
@@ -35,7 +36,7 @@ function title() {
   function node_type($type_name) {
     $type = entity_load('node_type', $type_name);
     $output = $type ? $type->label() : t('Unknown content type');
-    return check_plain($output);
+    return UtilityString::checkPlain($output);
   }
 
 }
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/argument/Vid.php b/core/modules/node/lib/Drupal/node/Plugin/views/argument/Vid.php
index 79ddd4d..e931690 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/views/argument/Vid.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/views/argument/Vid.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Plugin\views\argument;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Database\Connection;
 use Drupal\views\Plugin\views\argument\Numeric;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -66,7 +67,7 @@ public function titleQuery() {
 
     foreach ($results as $result) {
       $nodes[$result['nid']]->set('title', $result['title']);
-      $titles[] = check_plain($nodes[$result['nid']]->label());
+      $titles[] = String::checkPlain($nodes[$result['nid']]->label());
     }
 
     return $titles;
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php b/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php
index 2df6281..9bb5574 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Plugin\views\row;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Plugin\views\row\RowPluginBase;
 
 /**
@@ -74,7 +75,7 @@ public function buildOptionsForm_summary_options() {
 
   public function summaryTitle() {
     $options = $this->buildOptionsForm_summary_options();
-    return check_plain($options[$this->options['item_length']]);
+    return String::checkPlain($options[$this->options['item_length']]);
   }
 
   public function preRender($values) {
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php
index 78b402b..591dd25 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\node\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Tests hook_node_access_records() functionality.
  */
@@ -80,7 +82,7 @@ function testNodeAccessRecords() {
       $grants = node_test_node_grants($op, $web_user);
       $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/lib/Drupal/node/Tests/NodeLoadMultipleTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeLoadMultipleTest.php
index c858376..4d7a084 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeLoadMultipleTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeLoadMultipleTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\node\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Tests the node_load_multiple() function.
  */
@@ -54,12 +56,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_load_multiple(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/lib/Drupal/node/Tests/NodeTestBase.php b/core/modules/node/lib/Drupal/node/Tests/NodeTestBase.php
index dcb0518..98c6308 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeTestBase.php
+++ b/core/modules/node/lib/Drupal/node/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;
 
@@ -104,7 +105,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/lib/Drupal/node/Tests/NodeTokenReplaceTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php
index 717abcc..07c4e0a 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php
@@ -73,10 +73,10 @@ function testNodeTokenReplacement() {
     $tests['[node:vid]'] = $node->getRevisionId();
     $tests['[node:type]'] = 'article';
     $tests['[node:type-name]'] = 'Article';
-    $tests['[node:title]'] = check_plain($node->getTitle());
+    $tests['[node:title]'] = String::checkPlain($node->getTitle());
     $tests['[node:body]'] = $node->body->processed;
     $tests['[node:summary]'] = $node->body->summary_processed;
-    $tests['[node:langcode]'] = check_plain($node->language()->id);
+    $tests['[node:langcode]'] = String::checkPlain($node->language()->id);
     $tests['[node:url]'] = url('node/' . $node->id(), $url_options);
     $tests['[node:edit-url]'] = url('node/' . $node->id() . '/edit', $url_options);
     $tests['[node:author]'] = String::checkPlain($account->getUsername());
@@ -90,7 +90,7 @@ function testNodeTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $this->tokenService->replace($input, array('node' => $node), array('langcode' => $this->languageInterface->id));
-      $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.
@@ -102,7 +102,7 @@ function testNodeTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $this->tokenService->replace($input, array('node' => $node), array('langcode' => $this->languageInterface->id, '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.
@@ -123,7 +123,7 @@ function testNodeTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $this->tokenService->replace($input, array('node' => $node), array('language' => $this->languageInterface));
-      $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.
@@ -131,7 +131,7 @@ function testNodeTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $this->tokenService->replace($input, array('node' => $node), array('language' => $this->languageInterface, '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/lib/Drupal/node/Tests/NodeTranslationUITest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php
index afc0c57..5bcd4d5 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php
+++ b/core/modules/node/lib/Drupal/node/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;
 
@@ -334,7 +335,7 @@ protected function doTestTranslations($path, array $values) {
     $languages = language_list();
     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)));
     }
   }
 
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php
index 6cfc32f..f487727 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\node\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Tests related to node types.
  */
@@ -137,8 +139,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
@@ -153,8 +155,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/lib/Drupal/node/Tests/Views/FrontPageTest.php b/core/modules/node/lib/Drupal/node/Tests/Views/FrontPageTest.php
index b1f00ef..68cb7f8 100644
--- a/core/modules/node/lib/Drupal/node/Tests/Views/FrontPageTest.php
+++ b/core/modules/node/lib/Drupal/node/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;
@@ -59,7 +60,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/node/node.pages.inc b/core/modules/node/node.pages.inc
index fe5b0c1..e2f9cbe 100644
--- a/core/modules/node/node.pages.inc
+++ b/core/modules/node/node.pages.inc
@@ -9,6 +9,7 @@
  * @see node_menu()
  */
 
+use Drupal\Component\Utility\String;
 use Symfony\Component\HttpFoundation\RedirectResponse;
 use Drupal\node\NodeInterface;
 
@@ -143,7 +144,7 @@ function node_revision_overview($node) {
       $row[] = array('data' => t('!date by !username', array('!date' => l(format_date($revision->revision_timestamp, 'short'), 'node/' . $node->id()), '!username' => drupal_render($username)))
                                . (($revision->log != '') ? '<p class="revision-log">' . filter_xss($revision->log) . '</p>' : ''),
                      'class' => array('revision-current'));
-      $row[] = array('data' => drupal_placeholder(t('current revision')), 'class' => array('revision-current'));
+      $row[] = array('data' => String::placeholder(t('current revision')), 'class' => array('revision-current'));
     }
     else {
       $username = array(
diff --git a/core/modules/node/node.tokens.inc b/core/modules/node/node.tokens.inc
index dbf668c..cb0e271 100644
--- a/core/modules/node/node.tokens.inc
+++ b/core/modules/node/node.tokens.inc
@@ -5,6 +5,7 @@
  * Builds placeholder replacement tokens for node-related data.
  */
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 
 /**
@@ -116,16 +117,16 @@ function node_tokens($type, $tokens, array $data = array(), array $options = arr
           break;
 
         case 'type':
-          $replacements[$original] = $sanitize ? check_plain($node->getType()) : $node->getType();
+          $replacements[$original] = $sanitize ? String::checkPlain($node->getType()) : $node->getType();
           break;
 
         case 'type-name':
           $type_name = node_get_type_label($node);
-          $replacements[$original] = $sanitize ? check_plain($type_name) : $type_name;
+          $replacements[$original] = $sanitize ? String::checkPlain($type_name) : $type_name;
           break;
 
         case 'title':
-          $replacements[$original] = $sanitize ? check_plain($node->getTitle()) : $node->getTitle();
+          $replacements[$original] = $sanitize ? String::checkPlain($node->getTitle()) : $node->getTitle();
           break;
 
         case 'body':
@@ -165,7 +166,7 @@ function node_tokens($type, $tokens, array $data = array(), array $options = arr
           break;
 
         case 'langcode':
-          $replacements[$original] = $sanitize ? check_plain($node->language()->id) : $node->language()->id;
+          $replacements[$original] = $sanitize ? String::checkPlain($node->language()->id) : $node->language()->id;
           break;
 
         case 'url':
@@ -179,7 +180,7 @@ function node_tokens($type, $tokens, array $data = array(), array $options = arr
         // Default values for the chained tokens handled below.
         case 'author':
           $account = $node->getOwner() ? $node->getOwner() : user_load(0);
-          $replacements[$original] = $sanitize ? check_plain($account->label()) : $account->label();
+          $replacements[$original] = $sanitize ? String::checkPlain($account->label()) : $account->label();
           break;
 
         case 'created':
diff --git a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php
index dd6d13e..20640a2 100644
--- a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php
+++ b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\options\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\field\Tests\FieldTestBase;
 
 /**
@@ -316,7 +317,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/rdf/rdf.module b/core/modules/rdf/rdf.module
index bf8c60e..c5fdec7 100644
--- a/core/modules/rdf/rdf.module
+++ b/core/modules/rdf/rdf.module
@@ -5,6 +5,7 @@
  * Enables semantically enriched output for Drupal sites in the form of RDFa.
  */
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Template\Attribute;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
 
@@ -417,7 +418,7 @@ function rdf_preprocess_username(&$variables) {
   // Long usernames are truncated by template_preprocess_username(). Store the
   // full name in the content attribute so it can be extracted in RDFa.
   if ($variables['truncated']) {
-    $attributes['content'] = check_plain($variables['name_raw']);
+    $attributes['content'] = String::checkPlain($variables['name_raw']);
   }
   // The remaining attributes can have multiple values listed, with whitespace
   // separating the values in the RDFa attributes
diff --git a/core/modules/responsive_image/lib/Drupal/responsive_image/Entity/ResponsiveImageMapping.php b/core/modules/responsive_image/lib/Drupal/responsive_image/Entity/ResponsiveImageMapping.php
index 82e7ed0..58a8759 100644
--- a/core/modules/responsive_image/lib/Drupal/responsive_image/Entity/ResponsiveImageMapping.php
+++ b/core/modules/responsive_image/lib/Drupal/responsive_image/Entity/ResponsiveImageMapping.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\responsive_image\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Config\Entity\ConfigEntityBase;
 use Drupal\responsive_image\ResponsiveImageMappingInterface;
 
@@ -122,7 +123,7 @@ public function save() {
   public function createDuplicate() {
     return entity_create('responsive_image_mapping', array(
       'id' => '',
-      'label' => t('Clone of !label', array('!label' => check_plain($this->label()))),
+      'label' => t('Clone of !label', array('!label' => String::checkPlain($this->label()))),
       'mappings' => $this->getMappings(),
     ));
   }
diff --git a/core/modules/responsive_image/lib/Drupal/responsive_image/ResponsiveImageMappingFormController.php b/core/modules/responsive_image/lib/Drupal/responsive_image/ResponsiveImageMappingFormController.php
index 9b5e9c3..aed14b2 100644
--- a/core/modules/responsive_image/lib/Drupal/responsive_image/ResponsiveImageMappingFormController.php
+++ b/core/modules/responsive_image/lib/Drupal/responsive_image/ResponsiveImageMappingFormController.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\responsive_image;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityFormController;
 
 /**
@@ -78,7 +79,7 @@ public function form(array $form, array &$form_state) {
         $label = $multiplier . ' ' . $breakpoint->name . ' [' . $breakpoint->mediaQuery . ']';
         $form['mappings'][$breakpoint_id][$multiplier] = array(
           '#type' => 'select',
-          '#title' => check_plain($label),
+          '#title' => String::checkPlain($label),
           '#options' => $image_styles,
           '#default_value' => $image_style,
           '#description' => $this->t('Select an image style for this breakpoint.'),
diff --git a/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php b/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php
index 09111bf..55c34eb 100644
--- a/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php
+++ b/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php
@@ -8,6 +8,7 @@
 namespace Drupal\rest\Plugin\views\display;
 
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\KeyValueStore\StateInterface;
 use Drupal\Core\Routing\RouteProviderInterface;
 use Drupal\Core\ContentNegotiation;
@@ -295,7 +296,7 @@ public function render() {
     // Wrap the output in a pre tag if this is for a live preview.
     if (!empty($this->view->live_preview)) {
       $build['#prefix'] = '<pre>';
-      $build['#markup'] = check_plain($build['#markup']);
+      $build['#markup'] = String::checkPlain($build['#markup']);
       $build['#suffix'] = '</pre>';
     }
 
diff --git a/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php b/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php
index 2a72be5..e2ff66e 100644
--- a/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php
+++ b/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\rest\Tests\Views;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 use Drupal\views\Tests\Plugin\PluginTestBase;
 use Drupal\views\Tests\ViewTestData;
@@ -280,7 +281,7 @@ public function testPreview() {
       $entities[] = $row->_entity;
     }
 
-    $expected = check_plain($serializer->serialize($entities, 'json'));
+    $expected = String::checkPlain($serializer->serialize($entities, 'json'));
 
     $view->display_handler->setContentType('json');
     $view->live_preview = TRUE;
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php
index b470ae6..d3dcb09 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\search\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
 use Drupal\field\Field;
 
@@ -64,7 +65,7 @@ function testSearchResultsComment() {
     $instance = Field::fieldInfo()->getInstance('node', 'article', 'comment');
     $instance->settings['preview'] = DRUPAL_OPTIONAL;
     $instance->save();
-    // Enable check_plain() for 'Basic HTML' text format.
+    // Enable String::checkPlain() for 'Basic HTML' text format.
     $basic_html_format_id = 'basic_html';
     $edit = array(
       'filters[filter_html_escape][status]' => TRUE,
@@ -111,7 +112,7 @@ function testSearchResultsComment() {
     // Verify that comment is rendered using proper format.
     $this->assertText($comment_body, 'Comment body text found in search results.');
     $this->assertNoRaw(t('n/a'), 'HTML in comment body is not hidden.');
-    $this->assertNoRaw(check_plain($edit_comment['comment_body[0][value]']), 'HTML in comment body is not escaped.');
+    $this->assertNoRaw(String::checkPlain($edit_comment['comment_body[0][value]']), 'HTML in comment body is not escaped.');
 
     // Hide comments.
     $this->drupalLogin($this->admin_user);
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php
index 97030a6..51394b5 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\search\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Test config page.
  */
@@ -191,7 +193,7 @@ function testSearchModuleDisabling() {
       $this->drupalGet($path);
       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/lib/Drupal/search/Tests/SearchNumberMatchingTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchNumberMatchingTest.php
index f52a222..8bbd1f9 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchNumberMatchingTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchNumberMatchingTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\search\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 
 /**
@@ -72,7 +73,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.
@@ -85,7 +86,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/lib/Drupal/search/Tests/SearchNumbersTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchNumbersTest.php
index 6275943..b351d39 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchNumbersTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchNumbersTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\search\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 
 /**
@@ -92,7 +93,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/search.module b/core/modules/search/search.module
index e6ea9f0..32976c9 100644
--- a/core/modules/search/search.module
+++ b/core/modules/search/search.module
@@ -5,6 +5,7 @@
  * Enables site-wide keyword searching.
  */
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 
 /**
@@ -675,7 +676,7 @@ function search_excerpt($keys, $text, $langcode = NULL) {
     // We didn't find any keyword matches, so just return the first part of the
     // text. We also need to re-encode any HTML special characters that we
     // entity-decoded above.
-    return check_plain(truncate_utf8($text, 256, TRUE, TRUE));
+    return String::checkPlain(truncate_utf8($text, 256, TRUE, TRUE));
   }
 
   // Sort the text ranges by starting position.
@@ -716,7 +717,7 @@ function search_excerpt($keys, $text, $langcode = NULL) {
   // translated. Let translators have the ... separator text as one chunk.
   $dots = explode('!excerpt', t('... !excerpt ... !excerpt ...'));
   $text = (isset($new_ranges[0]) ? '' : $dots[0]) . implode($dots[1], $out) . (($max_end < strlen($text) - 1) ? $dots[2] : '');
-  $text = check_plain($text);
+  $text = String::checkPlain($text);
 
   // Highlight keywords. Must be done at once to prevent conflicts ('strong'
   // and '<strong>').
diff --git a/core/modules/search/search.pages.inc b/core/modules/search/search.pages.inc
index 34b235c..cad88f8 100644
--- a/core/modules/search/search.pages.inc
+++ b/core/modules/search/search.pages.inc
@@ -5,6 +5,7 @@
  * User page callbacks for the Search module.
  */
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 
 /**
@@ -35,7 +36,7 @@ function template_preprocess_search_result(&$variables) {
 
   $result = $variables['result'];
   $variables['url'] = check_url($result['link']);
-  $variables['title'] = check_plain($result['title']);
+  $variables['title'] = String::checkPlain($result['title']);
   if (isset($result['language']) && $result['language'] != $language_interface->id && $result['language'] != Language::LANGCODE_NOT_SPECIFIED) {
     $variables['title_attributes']['lang'] = $result['language'];
     $variables['content_attributes']['lang'] = $result['language'];
@@ -43,7 +44,7 @@ function template_preprocess_search_result(&$variables) {
 
   $info = array();
   if (!empty($result['plugin_id'])) {
-    $info['plugin_id'] = check_plain($result['plugin_id']);
+    $info['plugin_id'] = String::checkPlain($result['plugin_id']);
   }
   if (!empty($result['user'])) {
     $info['user'] = $result['user'];
@@ -60,4 +61,3 @@ function template_preprocess_search_result(&$variables) {
   $variables['info_split'] = $info;
   $variables['info'] = implode(' - ', $info);
 }
-
diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutSetsTest.php b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutSetsTest.php
index 2a31535..7a32e53 100644
--- a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutSetsTest.php
+++ b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutSetsTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\shortcut\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Defines shortcut set test cases.
  */
@@ -111,7 +113,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 = shortcut_set_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/shortcut.admin.inc b/core/modules/shortcut/shortcut.admin.inc
index 3408d83..1b683c0 100644
--- a/core/modules/shortcut/shortcut.admin.inc
+++ b/core/modules/shortcut/shortcut.admin.inc
@@ -5,6 +5,8 @@
  * Administrative page callbacks for the shortcut module.
  */
 
+use Drupal\Component\Utility\String;
+
 /**
  * Form callback: builds the form for switching shortcut sets.
  *
@@ -39,7 +41,7 @@ function shortcut_set_switch($form, &$form_state, $account = NULL) {
 
   $options = array();
   foreach ($sets as $name => $set) {
-    $options[$name] = check_plain($set->label());
+    $options[$name] = String::checkPlain($set->label());
   }
 
   // Only administrators can add shortcut sets.
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
index 7737cc8..e5bc001 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\simpletest;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DrupalKernel;
 use Drupal\Core\KeyValueStore\KeyValueMemoryFactory;
@@ -280,13 +281,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),
     )));
   }
@@ -306,7 +307,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,
       )));
     }
@@ -314,7 +315,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,
         )));
@@ -325,7 +326,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,
     )));
@@ -364,7 +365,7 @@ protected function enableModules(array $modules) {
     // no longer the $module_handler instance from above.
     $module_handler = $this->container->get('module_handler');
     $module_handler->reload();
-    $this->pass(format_string('Enabled modules: %modules.', array(
+    $this->pass(String::format('Enabled modules: %modules.', array(
       '%modules' => implode(', ', $modules),
     )));
   }
@@ -398,7 +399,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/lib/Drupal/simpletest/Tests/MailCaptureTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/MailCaptureTest.php
index 8cce823..9776cdd 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/MailCaptureTest.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/MailCaptureTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\simpletest\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 class MailCaptureTest extends WebTestBase {
@@ -50,7 +51,7 @@ function testMailSend() {
     // Assert that the e-mail 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 e-mail was sent and the value for property @field is intact.', array('@field' => $field)), 'E-mail');
+      $this->assertMail($field, $value, String::format('The e-mail was sent and the value for property @field is intact.', array('@field' => $field)), 'E-mail');
     }
 
     // Send additional e-mails so more than one e-mail is captured.
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
index 83f1048..53148af 100755
--- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\simpletest\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Database\Driver\pgsql\Select;
 use Drupal\simpletest\WebTestBase;
 
@@ -276,7 +277,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/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
index 61c54d1..a56f1e8 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
@@ -395,7 +395,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())));
   }
 
   /**
@@ -406,7 +406,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())));
   }
 
   /**
@@ -678,7 +678,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);
@@ -1404,7 +1404,7 @@ protected function drupalGet($path, array $options = array(), array $headers = a
     $verbose = 'GET request to: ' . $path .
                '<hr />Ending URL: ' . $this->getUrl();
     if ($this->dumpHeaders) {
-      $verbose .= '<hr />Headers: <pre>' . check_plain(var_export(array_map('trim', $this->headers), TRUE)) . '</pre>';
+      $verbose .= '<hr />Headers: <pre>' . String::checkPlain(var_export(array_map('trim', $this->headers), TRUE)) . '</pre>';
     }
     $verbose .= '<hr />' . $out;
 
@@ -1594,7 +1594,7 @@ protected function drupalPostForm($path, $edit, $submit, array $options = array(
           $verbose = 'POST request to: ' . $path;
           $verbose .= '<hr />Ending URL: ' . $this->getUrl();
           if ($this->dumpHeaders) {
-            $verbose .= '<hr />Headers: <pre>' . check_plain(var_export(array_map('trim', $this->headers), TRUE)) . '</pre>';
+            $verbose .= '<hr />Headers: <pre>' . String::checkPlain(var_export(array_map('trim', $this->headers), TRUE)) . '</pre>';
           }
           $verbose .= '<hr />Fields: ' . highlight_string('<?php ' . var_export($post_array, TRUE), TRUE);
           $verbose .= '<hr />' . $out;
@@ -1608,9 +1608,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)));
     }
   }
 
@@ -1994,7 +1994,7 @@ protected function drupalHead($path, array $options = array(), array $headers =
     if ($this->dumpHeaders) {
       $this->verbose('GET request to: ' . $path .
                      '<hr />Ending URL: ' . $this->getUrl() .
-                     '<hr />Headers: <pre>' . check_plain(var_export(array_map('trim', $this->headers), TRUE)) . '</pre>');
+                     '<hr />Headers: <pre>' . String::checkPlain(var_export(array_map('trim', $this->headers), TRUE)) . '</pre>');
     }
 
     return $out;
@@ -2275,8 +2275,9 @@ protected function getAllOptions(\SimpleXMLElement $element) {
    *   Link position counting from zero.
    * @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 \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param $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
@@ -2301,8 +2302,9 @@ protected function assertLink($label, $index = 0, $message = '', $group = 'Other
    *   Link position counting from zero.
    * @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 \Drupal\Component\Utility\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
@@ -2327,8 +2329,9 @@ protected function assertNoLink($label, $message = '', $group = 'Other') {
    *   Link position counting from zero.
    * @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 \Drupal\Component\Utility\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
@@ -2351,8 +2354,9 @@ protected function assertLinkByHref($href, $index = 0, $message = '', $group = '
    *   The full or partial value of the 'href' attribute of the anchor tag.
    * @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 \Drupal\Component\Utility\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
@@ -2611,8 +2615,9 @@ 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 \Drupal\Component\Utility\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
@@ -2645,8 +2650,9 @@ protected function assertUrl($path, array $options = array(), $message = '', $gr
    *   Raw (HTML) string to look 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 \Drupal\Component\Utility\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
@@ -2672,8 +2678,9 @@ protected function assertRaw($raw, $message = '', $group = 'Other') {
    *   Raw (HTML) string to look 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 \Drupal\Component\Utility\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
@@ -2701,8 +2708,9 @@ protected function assertNoRaw($raw, $message = '', $group = 'Other') {
    *   Plain text to look 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 \Drupal\Component\Utility\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
@@ -2727,8 +2735,9 @@ protected function assertText($text, $message = '', $group = 'Other') {
    *   Plain text to look 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 \Drupal\Component\Utility\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
@@ -2751,8 +2760,9 @@ protected function assertNoText($text, $message = '', $group = 'Other') {
    *   Plain text to look 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 \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param $group
    *   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
@@ -2785,8 +2795,9 @@ protected function assertTextHelper($text, $message = '', $group, $not_exists) {
    *   Plain text to look 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 \Drupal\Component\Utility\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
@@ -2811,8 +2822,9 @@ protected function assertUniqueText($text, $message = '', $group = 'Other') {
    *   Plain text to look 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 \Drupal\Component\Utility\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
@@ -2835,8 +2847,9 @@ protected function assertNoUniqueText($text, $message = '', $group = 'Other') {
    *   Plain text to look 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 \Drupal\Component\Utility\String::format() to embed
+   *   variables in the message text, not t(). If left blank, a default message
+   *   will be displayed.
    * @param $group
    *   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
@@ -2872,8 +2885,9 @@ protected function assertUniqueTextHelper($text, $message = '', $group, $be_uniq
    *   Perl regex to look for including the regex delimiters.
    * @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 \Drupal\Component\Utility\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
@@ -2897,8 +2911,9 @@ protected function assertPattern($pattern, $message = '', $group = 'Other') {
    *   Perl regex to look for including the regex delimiters.
    * @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 \Drupal\Component\Utility\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
@@ -2922,8 +2937,9 @@ protected function assertNoPattern($pattern, $message = '', $group = 'Other') {
    *   The string the title should be.
    * @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 \Drupal\Component\Utility\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
@@ -2951,8 +2967,9 @@ protected function assertTitle($title, $message = '', $group = 'Other') {
    *   The string the title should not be.
    * @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 \Drupal\Component\Utility\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
@@ -2984,8 +3001,9 @@ protected function assertNoTitle($title, $message = '', $group = 'Other') {
    *   The expected themed output string.
    * @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 \Drupal\Component\Utility\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
@@ -2997,15 +3015,15 @@ protected function assertNoTitle($title, $message = '', $group = 'Other') {
    */
   protected function assertThemeOutput($callback, array $variables = array(), $expected, $message = '', $group = 'Other') {
     $output = _theme($callback, $variables);
-    $this->verbose('Variables:' . '<pre>' .  check_plain(var_export($variables, TRUE)) . '</pre>'
-      . '<hr />' . 'Result:' . '<pre>' .  check_plain(var_export($output, TRUE)) . '</pre>'
-      . '<hr />' . 'Expected:' . '<pre>' .  check_plain(var_export($expected, TRUE)) . '</pre>'
+    $this->verbose('Variables:' . '<pre>' .  String::checkPlain(var_export($variables, TRUE)) . '</pre>'
+      . '<hr />' . 'Result:' . '<pre>' .  String::checkPlain(var_export($output, TRUE)) . '</pre>'
+      . '<hr />' . 'Expected:' . '<pre>' .  String::checkPlain(var_export($expected, TRUE)) . '</pre>'
       . '<hr />' . $output
     );
     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);
   }
 
@@ -3018,8 +3036,9 @@ protected function assertThemeOutput($callback, array $variables = array(), $exp
    *   (optional) 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 \Drupal\Component\Utility\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
@@ -3098,8 +3117,9 @@ protected function getSelectedItem(\SimpleXMLElement $element) {
    *   (optional) 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 \Drupal\Component\Utility\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
@@ -3136,8 +3156,9 @@ protected function assertNoFieldByXPath($xpath, $value = NULL, $message = '', $g
    *   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 \Drupal\Component\Utility\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
@@ -3173,8 +3194,9 @@ protected function assertFieldByName($name, $value = NULL, $message = NULL, $gro
    *   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 \Drupal\Component\Utility\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
@@ -3197,8 +3219,9 @@ protected function assertNoFieldByName($name, $value = '', $message = '', $group
    *   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 \Drupal\Component\Utility\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
@@ -3221,8 +3244,9 @@ protected function assertFieldById($id, $value = '', $message = '', $group = 'Br
    *   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 \Drupal\Component\Utility\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
@@ -3243,8 +3267,9 @@ protected function assertNoFieldById($id, $value = '', $message = '', $group = '
    *   Id of 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 \Drupal\Component\Utility\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
@@ -3266,8 +3291,9 @@ protected function assertFieldChecked($id, $message = '', $group = 'Browser') {
    *   Id of 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 \Drupal\Component\Utility\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
@@ -3291,8 +3317,9 @@ protected function assertNoFieldChecked($id, $message = '', $group = 'Browser')
    *   Option 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 \Drupal\Component\Utility\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
@@ -3316,8 +3343,9 @@ protected function assertOption($id, $option, $message = '', $group = 'Browser')
    *   Option 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 \Drupal\Component\Utility\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
@@ -3342,8 +3370,9 @@ protected function assertNoOption($id, $option, $message = '', $group = 'Browser
    *   Option 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 \Drupal\Component\Utility\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
@@ -3369,8 +3398,9 @@ protected function assertOptionSelected($id, $option, $message = '', $group = 'B
    *   Option 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 \Drupal\Component\Utility\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
@@ -3392,8 +3422,9 @@ protected function assertNoOptionSelected($id, $option, $message = '', $group =
    *   Name or id of 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 \Drupal\Component\Utility\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
@@ -3414,8 +3445,9 @@ protected function assertField($field, $message = '', $group = 'Other') {
    *   Name or id of 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 \Drupal\Component\Utility\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
@@ -3434,8 +3466,9 @@ protected function assertNoField($field, $message = '', $group = 'Other') {
    *
    * @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 \Drupal\Component\Utility\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
@@ -3489,8 +3522,9 @@ protected function constructFieldXpath($attribute, $value) {
    *   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 \Drupal\Component\Utility\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
@@ -3514,8 +3548,9 @@ 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 \Drupal\Component\Utility\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
@@ -3543,8 +3578,9 @@ 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 \Drupal\Component\Utility\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
@@ -3571,8 +3607,9 @@ protected function assertMail($name, $value = '', $message = '', $group = 'E-mai
    *   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 \Drupal\Component\Utility\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
@@ -3597,7 +3634,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);
   }
@@ -3611,8 +3648,9 @@ 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 \Drupal\Component\Utility\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
@@ -3627,7 +3665,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/simpletest/simpletest.install b/core/modules/simpletest/simpletest.install
index 917a938..6236675 100644
--- a/core/modules/simpletest/simpletest.install
+++ b/core/modules/simpletest/simpletest.install
@@ -5,6 +5,8 @@
  * Install, update and uninstall functions for the simpletest module.
  */
 
+use Drupal\Component\Utility\String;
+
 /**
  * Minimum value of PHP memory_limit for SimpleTest.
  */
@@ -65,7 +67,7 @@ function simpletest_requirements($phase) {
       'value' => is_dir(DRUPAL_ROOT . '/' . $site_directory) ? t('Not writable') : t('Missing'),
       'severity' => REQUIREMENT_ERROR,
       'description' => t('The testing framework requires the !sites-simpletest directory to exist and be writable in order to run tests.', array(
-        '!sites-simpletest' => '<code>./' . check_plain($site_directory) . '</code>',
+        '!sites-simpletest' => '<code>./' . String::checkPlain($site_directory) . '</code>',
       )),
     );
   }
@@ -75,7 +77,7 @@ function simpletest_requirements($phase) {
       'value' => t('Not protected'),
       'severity' => REQUIREMENT_ERROR,
       'description' => t('The file !file does not exist and could not be created automatically, which poses a security risk. Ensure that the directory is writable.', array(
-        '!file' => '<code>./' . check_plain($site_directory) . '/.htaccess</code>',
+        '!file' => '<code>./' . String::checkPlain($site_directory) . '/.htaccess</code>',
       )),
     );
   }
diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php
index 712c5ab..df8ad09 100644
--- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php
+++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\statistics\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 
 /**
@@ -57,7 +58,7 @@ function testStatisticsTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = \Drupal::token()->replace($input, array('node' => $node), array('langcode' => $language_interface->id));
-      $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/form.api.php b/core/modules/system/form.api.php
index cbef68c..3a32863 100644
--- a/core/modules/system/form.api.php
+++ b/core/modules/system/form.api.php
@@ -5,6 +5,8 @@
  * Callbacks provided by the form system.
  */
 
+use Drupal\Component\Utility\String;
+
 /**
  * @addtogroup callbacks
  * @{
@@ -74,7 +76,7 @@ function callback_batch_operation($MULTIPLE_PARAMS, &$context) {
     node_save($node);
 
     // Store some result for post-processing in the finished callback.
-    $context['results'][] = check_plain($node->title);
+    $context['results'][] = String::checkPlain($node->title);
 
     // Update our progress information.
     $context['sandbox']['progress']++;
diff --git a/core/modules/system/lib/Drupal/system/Form/FileSystemForm.php b/core/modules/system/lib/Drupal/system/Form/FileSystemForm.php
index 2d51684..dfec8d5 100644
--- a/core/modules/system/lib/Drupal/system/Form/FileSystemForm.php
+++ b/core/modules/system/lib/Drupal/system/Form/FileSystemForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Form;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\StreamWrapper\PublicStream;
 use Drupal\Core\Form\ConfigFormBase;
 
@@ -55,7 +56,7 @@ public function buildForm(array $form, array &$form_state) {
     // Any visible, writeable wrapper can potentially be used for the files
     // directory, including a remote file system that integrates with a CDN.
     foreach (file_get_stream_wrappers(STREAM_WRAPPERS_WRITE_VISIBLE) as $scheme => $info) {
-      $options[$scheme] = check_plain($info['description']);
+      $options[$scheme] = String::checkPlain($info['description']);
     }
 
     if (!empty($options)) {
diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php
index 2148451..770712e 100644
--- a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php
+++ b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Form;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\Query\QueryFactory;
@@ -103,7 +104,7 @@ public function getFormId() {
    */
   public function buildForm(array $form, array &$form_state) {
     require_once DRUPAL_ROOT . '/core/includes/install.inc';
-    $distribution = check_plain(drupal_install_profile_distribution_name());
+    $distribution = String::checkPlain(drupal_install_profile_distribution_name());
 
     // Include system.admin.inc so we can use the sort callbacks.
     $this->moduleHandler->loadInclude('system', 'inc', 'system.admin');
diff --git a/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php b/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
index aa51ab5..3addd12 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
+++ b/core/modules/system/lib/Drupal/system/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;
@@ -147,9 +148,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')));
@@ -158,9 +159,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;
@@ -173,8 +174,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')));
@@ -184,14 +185,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
@@ -199,8 +200,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/lib/Drupal/system/Tests/Cache/ClearTest.php b/core/modules/system/lib/Drupal/system/Tests/Cache/ClearTest.php
index f8e9499..bc2f437 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Cache/ClearTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Cache/ClearTest.php
@@ -10,6 +10,7 @@
 /**
  * Tests cache clearing methods.
  */
+use Drupal\Component\Utility\String;
 use Drupal\Core\Cache\Cache;
 
 class ClearTest extends CacheTestBase {
@@ -46,7 +47,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/lib/Drupal/system/Tests/Common/AddFeedTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/AddFeedTest.php
index b871710..9b5e312 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/AddFeedTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/AddFeedTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Common;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -78,7 +79,7 @@ function testBasicFeedAddNoTitle() {
 
     $this->drupalSetContent(drupal_get_html_head());
     foreach ($urls as $description => $feed_info) {
-      $this->assertPattern($this->urlToRSSLinkPattern($feed_info['output_url'], $feed_info['title']), format_string('Found correct feed header for %description', array('%description' => $description)));
+      $this->assertPattern($this->urlToRSSLinkPattern($feed_info['output_url'], $feed_info['title']), String::format('Found correct feed header for %description', array('%description' => $description)));
     }
   }
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php
index 5c016ce..536868f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/CascadingStylesheetsTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Common;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 use Drupal\simpletest\DrupalUnitTestBase;
 
@@ -79,7 +80,7 @@ function testRenderFile() {
     $this->assertTrue(strpos($styles, $css) > 0, 'Rendered CSS includes the added stylesheet.');
     // Verify that newlines are properly added inside style tags.
     $query_string = $this->container->get('state')->get('system.css_js_query_string') ?: '0';
-    $css_processed = '<link rel="stylesheet" href="' . check_plain(file_create_url($css)) . "?" . $query_string . '" media="all" />';
+    $css_processed = '<link rel="stylesheet" href="' . String::checkPlain(file_create_url($css)) . "?" . $query_string . '" media="all" />';
     $this->assertEqual(trim($styles), $css_processed, 'Rendered CSS includes newlines inside style tags for JavaScript use.');
   }
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/RegionContentTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/RegionContentTest.php
index e8b8201..d3d91bd 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/RegionContentTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/RegionContentTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Common;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -43,13 +44,13 @@ function testRegions() {
     // Ensure drupal_get_region_content returns expected results when fetching all regions.
     $content = drupal_get_region_content(NULL, $delimiter);
     foreach ($content as $region => $region_content) {
-      $this->assertEqual($region_content, $values[$region], format_string('@region region text verified when fetching all regions', array('@region' => $region)));
+      $this->assertEqual($region_content, $values[$region], String::format('@region region text verified when fetching all regions', array('@region' => $region)));
     }
 
     // Ensure drupal_get_region_content returns expected results when fetching a single region.
     foreach ($block_regions as $region) {
       $region_content = drupal_get_region_content($region, $delimiter);
-      $this->assertEqual($region_content, $values[$region], format_string('@region region text verified when fetching single region.', array('@region' => $region)));
+      $this->assertEqual($region_content, $values[$region], String::format('@region region text verified when fetching single region.', array('@region' => $region)));
     }
   }
 }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/RenderWebTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/RenderWebTest.php
index 8168b96..f5b1f16 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/RenderWebTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/RenderWebTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Common;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -153,15 +154,15 @@ function testDrupalRenderFormElements() {
   protected function assertRenderedElement(array $element, $xpath, array $xpath_args = array()) {
     $original_element = $element;
     $this->drupalSetContent(drupal_render($element));
-    $this->verbose('<pre>' .  check_plain(var_export($original_element, TRUE)) . '</pre>'
-      . '<pre>' .  check_plain(var_export($element, TRUE)) . '</pre>'
+    $this->verbose('<pre>' .  String::checkPlain(var_export($original_element, TRUE)) . '</pre>'
+      . '<pre>' .  String::checkPlain(var_export($element, TRUE)) . '</pre>'
       . '<hr />' . $this->drupalGetContent()
     );
 
     // @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/lib/Drupal/system/Tests/Common/SimpleTestErrorCollectorTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/SimpleTestErrorCollectorTest.php
index b32c6fc..c4b247f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/SimpleTestErrorCollectorTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/SimpleTestErrorCollectorTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Common;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -94,11 +95,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/lib/Drupal/system/Tests/Common/SystemListingTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/SystemListingTest.php
index 7962e49..0d978b0 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/SystemListingTest.php
+++ b/core/modules/system/lib/Drupal/system/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;
 
@@ -50,7 +51,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)));
       }
     }
 
@@ -62,7 +63,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/lib/Drupal/system/Tests/Common/TableSortExtenderUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/TableSortExtenderUnitTest.php
index 59eca4a..6876e94 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/TableSortExtenderUnitTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/TableSortExtenderUnitTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Common;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\UnitTestBase;
 use Symfony\Component\HttpFoundation\Request;
 
@@ -43,7 +44,7 @@ function testTableSortInit() {
     $request->query->replace(array());
     \Drupal::getContainer()->set('request', $request);
     $ts = tablesort_init($headers);
-    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
+    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => String::checkPlain(var_export($ts, TRUE)))));
     $this->assertEqual($ts, $expected_ts, 'Simple table headers sorted correctly.');
 
     // Test with simple table headers plus $_GET parameters that should _not_
@@ -56,7 +57,7 @@ function testTableSortInit() {
     ));
     \Drupal::getContainer()->set('request', $request);
     $ts = tablesort_init($headers);
-    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
+    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => String::checkPlain(var_export($ts, TRUE)))));
     $this->assertEqual($ts, $expected_ts, 'Simple table headers plus non-overriding $_GET parameters sorted correctly.');
 
     // Test with simple table headers plus $_GET parameters that _should_
@@ -72,7 +73,7 @@ function testTableSortInit() {
     $expected_ts['sort'] = 'desc';
     $expected_ts['query'] = array('alpha' => 'beta');
     $ts = tablesort_init($headers);
-    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
+    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => String::checkPlain(var_export($ts, TRUE)))));
     $this->assertEqual($ts, $expected_ts, 'Simple table headers plus $_GET parameters sorted correctly.');
 
     // Test complex table headers.
@@ -104,7 +105,7 @@ function testTableSortInit() {
       'sort' => 'desc',
       'query' => array(),
     );
-    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
+    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => String::checkPlain(var_export($ts, TRUE)))));
     $this->assertEqual($ts, $expected_ts, 'Complex table headers sorted correctly.');
 
     // Test complex table headers plus $_GET parameters that should _not_
@@ -123,7 +124,7 @@ function testTableSortInit() {
       'sort' => 'asc',
       'query' => array(),
     );
-    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
+    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => String::checkPlain(var_export($ts, TRUE)))));
     $this->assertEqual($ts, $expected_ts, 'Complex table headers plus non-overriding $_GET parameters sorted correctly.');
 
     // Test complex table headers plus $_GET parameters that _should_
@@ -144,7 +145,7 @@ function testTableSortInit() {
       'query' => array('alpha' => 'beta'),
     );
     $ts = tablesort_init($headers);
-    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
+    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => String::checkPlain(var_export($ts, TRUE)))));
     $this->assertEqual($ts, $expected_ts, 'Complex table headers plus $_GET parameters sorted correctly.');
   }
 }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/UrlTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/UrlTest.php
index 3487fd4..c28d75f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/UrlTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/UrlTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Common;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 use Drupal\simpletest\WebTestBase;
 use Symfony\Component\HttpFoundation\Request;
@@ -39,7 +40,7 @@ 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 #type 'link'.
     $link_array =  array(
@@ -49,7 +50,7 @@ function testLinkXSS() {
     );
     $type_link = drupal_render($link_array);
     $sanitized_path = check_url(url($path));
-    $this->assertTrue(strpos($type_link, $sanitized_path) !== FALSE, format_string('XSS attack @path was filtered by #theme', array('@path' => $path)));
+    $this->assertTrue(strpos($type_link, $sanitized_path) !== FALSE, String::format('XSS attack @path was filtered by #theme', array('@path' => $path)));
   }
 
   /**
@@ -74,10 +75,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();
@@ -118,7 +119,7 @@ function testLinkAttributes() {
     // Test l().
     $class_l = $this->randomName();
     $link_l = l($this->randomName(), current_path(), array('attributes' => array('class' => array($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->randomName();
@@ -133,7 +134,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/lib/Drupal/system/Tests/Database/ConnectionUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/ConnectionUnitTest.php
index 430a1b6..5e9ffda 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Database/ConnectionUnitTest.php
+++ b/core/modules/system/lib/Drupal/system/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\UnitTestBase;
 
@@ -88,7 +89,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)));
   }
 
   /**
@@ -99,7 +100,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/lib/Drupal/system/Tests/Database/InsertLobTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/InsertLobTest.php
index 63ffd29..13e0047 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Database/InsertLobTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Database/InsertLobTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\system\Tests\Database;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Tests inserts using LOB fields, which are weird on some databases.
  */
@@ -30,7 +32,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/lib/Drupal/system/Tests/Database/SchemaTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/SchemaTest.php
index 2442875..4405dc8 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Database/SchemaTest.php
+++ b/core/modules/system/lib/Drupal/system/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;
@@ -241,8 +242,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'])));
     }
   }
 
@@ -361,7 +362,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);
@@ -378,7 +379,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++) {
@@ -388,7 +389,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/lib/Drupal/system/Tests/Database/SelectComplexTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/SelectComplexTest.php
index 7e7d24d..6229136 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Database/SelectComplexTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Database/SelectComplexTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Database;
 
+use Drupal\Component\Utility\String;
 use \Drupal\Core\Database\RowCountException;
 
 /**
@@ -108,7 +109,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.');
@@ -142,7 +143,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/lib/Drupal/system/Tests/Database/SelectPagerDefaultTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/SelectPagerDefaultTest.php
index 79c93d2..7917fb9 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Database/SelectPagerDefaultTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Database/SelectPagerDefaultTest.php
@@ -6,6 +6,7 @@
  */
 
 namespace Drupal\system\Tests\Database;
+use Drupal\Component\Utility\String;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
@@ -51,7 +52,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)));
     }
   }
 
@@ -85,7 +86,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/lib/Drupal/system/Tests/Database/SelectTableSortDefaultTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/SelectTableSortDefaultTest.php
index 200a82a..a3c4f50 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Database/SelectTableSortDefaultTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Database/SelectTableSortDefaultTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\system\Tests\Database;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Tests the tablesort query extender.
  */
@@ -71,8 +73,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/lib/Drupal/system/Tests/Database/TransactionTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/TransactionTest.php
index f2257eb..93938ce 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Database/TransactionTest.php
+++ b/core/modules/system/lib/Drupal/system/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;
@@ -366,7 +367,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);
@@ -382,7 +383,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);
@@ -501,4 +502,3 @@ function testTransactionStacking() {
     $this->assertRowAbsent('inner2');
   }
 }
-
diff --git a/core/modules/system/lib/Drupal/system/Tests/Database/UpdateLobTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/UpdateLobTest.php
index 88a98d0..951cd3f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Database/UpdateLobTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Database/UpdateLobTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\system\Tests\Database;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Tests UPDATE queries involving LOB values.
  */
@@ -37,7 +39,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/lib/Drupal/system/Tests/Entity/EntityAccessTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityAccessTest.php
index 296b32f..3e4ddc0 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityAccessTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityAccessTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Access\AccessibleInterface;
@@ -35,7 +36,7 @@ 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/lib/Drupal/system/Tests/Entity/EntityApiTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityApiTest.php
index a9f0105..c9fce7b 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityApiTest.php
+++ b/core/modules/system/lib/Drupal/system/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;
 
@@ -65,32 +66,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/lib/Drupal/system/Tests/Entity/EntityFieldTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php
index 61c8c87..0838a58 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php
+++ b/core/modules/system/lib/Drupal/system/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\FieldDefinition;
 use Drupal\Core\Field\FieldDefinitionInterface;
@@ -102,71 +103,71 @@ protected function assertReadWrite($entity_type) {
     $entity = $this->createTestEntity($entity_type);
 
     // 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->randomName();
     $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->randomName();
     $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 user name 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 user name 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 user name 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 user name 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.');
@@ -181,33 +182,33 @@ protected function assertReadWrite($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(Language::LANGCODE_NOT_SPECIFIED, $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual(language_load(Language::LANGCODE_NOT_SPECIFIED), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(Language::LANGCODE_NOT_SPECIFIED, $entity->langcode->value, String::format('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(language_load(Language::LANGCODE_NOT_SPECIFIED), $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 = language_default()->id;
-    $this->assertEqual(language_default()->id, $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual(language_default(), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(language_default()->id, $entity->langcode->value, String::format('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(language_default(), $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 = Language::LANGCODE_NOT_SPECIFIED;
     $entity->langcode->language = language_default();
-    $this->assertEqual(language_default()->id, $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual(language_default(), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(language_default()->id, $entity->langcode->value, String::format('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(language_default(), $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->randomName();
     $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->randomName();
@@ -222,10 +223,10 @@ protected function assertReadWrite($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);
@@ -233,53 +234,53 @@ protected function assertReadWrite($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;
@@ -288,8 +289,8 @@ protected function assertReadWrite($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(
@@ -297,8 +298,8 @@ protected function assertReadWrite($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)));
   }
 
   /**
@@ -320,19 +321,19 @@ public function testSave() {
   protected function assertSave($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(Language::LANGCODE_NOT_SPECIFIED, $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual(language_load(Language::LANGCODE_NOT_SPECIFIED), $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(Language::LANGCODE_NOT_SPECIFIED, $entity->langcode->value, String::format('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(language_load(Language::LANGCODE_NOT_SPECIFIED), $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)));
   }
 
   /**
@@ -470,8 +471,8 @@ protected function assertIterator($entity_type) {
     }
 
     $properties = $entity->getProperties();
-    $this->assertEqual(array_keys($properties), array_keys($entity->getDataDefinition()->getPropertyDefinitions()), format_string('%entity_type: All properties returned.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($properties, iterator_to_array($entity->getIterator()), format_string('%entity_type: Entity iterator iterates over all properties.', array('%entity_type' => $entity_type)));
+    $this->assertEqual(array_keys($properties), array_keys($entity->getDataDefinition()->getPropertyDefinitions()), String::format('%entity_type: All properties returned.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($properties, iterator_to_array($entity->getIterator()), String::format('%entity_type: Entity iterator iterates over all properties.', array('%entity_type' => $entity_type)));
   }
 
   /**
@@ -511,7 +512,7 @@ protected function assertDataStructureInterfaces($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)));
   }
 
   /**
@@ -632,11 +633,11 @@ protected function assertComputedProperties($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/lib/Drupal/system/Tests/Entity/EntityFormTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFormTest.php
index 66940a7..78bf72a 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFormTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFormTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -74,19 +75,19 @@ 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'] = $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->drupalPostForm($entity_type . '/manage/' . $entity->id(), array(), t('Delete'));
     $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/lib/Drupal/system/Tests/Entity/EntityOperationsTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityOperationsTest.php
index fa75e9f..38092ae 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityOperationsTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityOperationsTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -50,7 +51,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/lib/Drupal/system/Tests/Entity/EntityQueryTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php
index 70f180e..6ca36b4 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Language\Language;
 use Symfony\Component\HttpFoundation\Request;
@@ -497,7 +498,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/lib/Drupal/system/Tests/Entity/EntityRevisionsTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityRevisionsTest.php
index b64ec89..48a43f8 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityRevisionsTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityRevisionsTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -85,9 +86,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++) {
@@ -95,15 +96,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', $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', $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/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php
index 7b72ee5..586f8b8 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 use Drupal\entity_test\Entity\EntityTestMulRev;
 
@@ -44,49 +45,49 @@ protected function _testEntityLanguageMethods($entity_type) {
       'name' => 'test',
       'user_id' => $this->container->get('current_user')->id(),
     ));
-    $this->assertEqual($entity->language()->id, Language::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()->id, Language::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(Language::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(), Language::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(), Language::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(), Language::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(), Language::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(), language_load($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(), language_load($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);
@@ -97,7 +98,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 {
@@ -111,10 +112,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.
@@ -122,8 +123,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)));
   }
 
   /**
@@ -153,19 +154,19 @@ protected function _testMultilingualProperties($entity_type) {
     $entity->save();
     $entity = entity_load($entity_type, $entity->id());
     $default_langcode = $entity->language()->id;
-    $this->assertEqual($default_langcode, Language::LANGCODE_NOT_SPECIFIED, format_string('%entity_type: Entity created as language neutral.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($default_langcode, Language::LANGCODE_NOT_SPECIFIED, String::format('%entity_type: Entity created as language neutral.', array('%entity_type' => $entity_type)));
     $field = $entity->getTranslation(Language::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(Language::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(Language::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.
@@ -173,21 +174,21 @@ protected function _testMultilingualProperties($entity_type) {
     $entity->save();
     $entity = entity_load($entity_type, $entity->id());
     $default_langcode = $entity->language()->id;
-    $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 Language::LANGCODE_NOT_SPECIFIED is passed.
     $field = $entity->getTranslation(Language::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(Language::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(Language::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();
@@ -220,10 +221,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()->id) ? $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).
@@ -237,24 +238,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.
@@ -266,7 +267,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);
@@ -285,7 +286,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)));
   }
 
   /**
@@ -356,7 +357,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->randomName());
         $this->fail($message);
@@ -378,7 +379,7 @@ function testEntityTranslationAPI() {
     // Check that removing an invalid translation causes an exception to be
     // thrown.
     foreach (array($default_langcode, Language::LANGCODE_DEFAULT, $this->randomName()) 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);
@@ -533,7 +534,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/lib/Drupal/system/Tests/File/DirectoryTest.php b/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php
index d17db20..4b36af7 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\system\Tests\File;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Directory related tests.
  */
@@ -113,14 +115,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/lib/Drupal/system/Tests/File/MimeTypeTest.php b/core/modules/system/lib/Drupal/system/Tests/File/MimeTypeTest.php
index e9c388d..57c6ce1 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/MimeTypeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/MimeTypeTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\system\Tests\File;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Tests for file_get_mimetype().
  */
@@ -54,11 +56,11 @@ public function testFileMimeTypeDetection() {
     foreach ($test_case as $input => $expected) {
       // Test stream [URI].
       $output = file_get_mimetype($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 = file_get_mimetype($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 passing in the map.
@@ -91,7 +93,7 @@ public function testFileMimeTypeDetection() {
 
     foreach ($test_case as $input => $expected) {
       $output = file_get_mimetype($input, $mapping);
-      $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/lib/Drupal/system/Tests/File/NameMungingTest.php b/core/modules/system/lib/Drupal/system/Tests/File/NameMungingTest.php
index 9c0d3d9..fdbe444 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/NameMungingTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/NameMungingTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\system\Tests\File;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Tests for file_munge_filename() and file_unmunge_filename().
  */
@@ -34,7 +36,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)));
   }
 
   /**
@@ -53,7 +55,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)));
   }
 
   /**
@@ -62,7 +64,7 @@ function testMungeIgnoreInsecure() {
   function testMungeIgnoreWhitelisted() {
     // Declare our extension as whitelisted.
     $munged_name = file_munge_filename($this->name, $this->bad_extension);
-    $this->assertIdentical($munged_name, $this->name, format_string('The new filename (%munged) matches the original (%original) once the extension has been whitelisted.', array('%munged' => $munged_name, '%original' => $this->name)));
+    $this->assertIdentical($munged_name, $this->name, String::format('The new filename (%munged) matches the original (%original) once the extension has been whitelisted.', array('%munged' => $munged_name, '%original' => $this->name)));
   }
 
   /**
@@ -71,6 +73,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/lib/Drupal/system/Tests/Form/CheckboxTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/CheckboxTest.php
index 228c576..1c17b61 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/CheckboxTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/CheckboxTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -58,7 +59,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);
       }
     }
@@ -80,7 +81,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');
@@ -88,7 +89,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/lib/Drupal/system/Tests/Form/ElementTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ElementTest.php
index 32120b2..9774df2 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/ElementTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/ElementTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -41,7 +42,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.
@@ -87,7 +88,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,
       )));
     }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/ElementsTableSelectTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ElementsTableSelectTest.php
index 9ce3fb2..50ced78 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/ElementsTableSelectTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/ElementsTableSelectTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -43,7 +44,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)));
     }
   }
 
@@ -60,7 +61,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)));
     }
   }
 
@@ -82,7 +83,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/lib/Drupal/system/Tests/Form/FormTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php
index e2ef22c..f65d146 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php
+++ b/core/modules/system/lib/Drupal/system/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),
@@ -348,7 +348,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),
@@ -420,10 +420,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));
           }
         }
       }
@@ -556,7 +556,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.
@@ -607,11 +607,11 @@ function testDisabledMarkup() {
       $path = strtr($path, array('!type' => $type));
       // Verify that the element exists.
       $element = $this->xpath($path, array(
-        ':name' => check_plain($name),
+        ':name' => String::checkPlain($name),
         ':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.
@@ -619,12 +619,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]')));
   }
 
   /**
@@ -652,7 +652,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/lib/Drupal/system/Tests/Form/LanguageSelectElementTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/LanguageSelectElementTest.php
index 0acd6b2..171a928 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/LanguageSelectElementTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/LanguageSelectElementTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Json;
 use Drupal\simpletest\WebTestBase;
 use Drupal\Core\Language\Language;
@@ -57,7 +58,7 @@ function testLanguageSelectElementOptions() {
                  'edit-languages-locked' => Language::STATE_LOCKED,
                  'edit-languages-config-and-locked' => Language::STATE_CONFIGURABLE | Language::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();
       foreach (language_list($flags) as $langcode => $language) {
         $options[$langcode] = $language->locked ? t('- @name -', array('@name' => $language->name)) : $language->name;
@@ -66,7 +67,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'));
   }
 
@@ -83,7 +84,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
@@ -118,6 +119,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/lib/Drupal/system/Tests/Form/ProgrammaticTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ProgrammaticTest.php
index 6753239..e8ae8aa 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/ProgrammaticTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/ProgrammaticTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -87,7 +88,7 @@ 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) {
@@ -95,7 +96,7 @@ private function submitForm($values, $valid_input) {
       // submission handler was properly executed.
       $stored_values = $form_state['storage']['programmatic_form_submit'];
       foreach ($values as $key => $value) {
-        $this->assertTrue(isset($stored_values[$key]) && $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->assertTrue(isset($stored_values[$key]) && $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/lib/Drupal/system/Tests/Form/StateValuesCleanTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/StateValuesCleanTest.php
index e6f844f..0527e76 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/StateValuesCleanTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/StateValuesCleanTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Json;
 use Drupal\simpletest\WebTestBase;
 
@@ -43,16 +44,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/lib/Drupal/system/Tests/Form/ValidationTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ValidationTest.php
index bda5872..8c249f5 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/ValidationTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/ValidationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -100,7 +101,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/lib/Drupal/system/Tests/Installer/InstallerLanguageTest.php b/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerLanguageTest.php
index 93a610b..725545a 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerLanguageTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerLanguageTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Installer;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 use Drupal\Core\StringTranslation\Translator\FileTranslation;
 
@@ -39,9 +40,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/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php b/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php
index 0f6f6aa..b9426ca 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Mail/HtmlToTextTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Mail;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 use Drupal\Component\Utility\Settings;
 
@@ -37,7 +38,7 @@ protected function stringToHtml($text) {
       str_replace(
         array("\n", ' '),
         array('\n', '&nbsp;'),
-        check_plain($text)
+        String::checkPlain($text)
       ) . '"';
   }
 
@@ -59,7 +60,7 @@ protected function assertHtmlToText($html, $text, $message, $allowed_tags = NULL
     $tested_tags = implode(', ', array_unique($matches[1]));
     $message .= ' (' . $tested_tags . ')';
     $result = drupal_html_to_text($html, $allowed_tags);
-    $pass = $this->assertEqual($result, $text, check_plain($message));
+    $pass = $this->assertEqual($result, $text, String::checkPlain($message));
     $verbose = 'html = <pre>' . $this->stringToHtml($html)
       . '</pre><br />' . 'result = <pre>' . $this->stringToHtml($result)
       . '</pre><br />' . 'expected = <pre>' . $this->stringToHtml($text)
diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
index bda7efe..4bea6f3 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Menu;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Unicode;
 
 /**
@@ -272,7 +273,7 @@ function testBreadCrumbs() {
         $link['link_path'] => $link['link_title'],
       );
       $this->assertBreadcrumb($link['link_path'], $trail, $term->getName(), $tree);
-      $this->assertRaw(check_plain($parent->getTitle()), 'Tagged node found.');
+      $this->assertRaw(String::checkPlain($parent->getTitle()), 'Tagged node found.');
 
       // Additionally make sure that this link appears only once; i.e., the
       // untranslated menu links automatically generated from menu router items
diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/LinksTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/LinksTest.php
index 8148c7a..bb6b41d 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Menu/LinksTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/LinksTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Menu;
 
+use Drupal\Component\Utility\String;
 use Drupal\locale\TranslationString;
 use Drupal\simpletest\WebTestBase;
 
@@ -97,7 +98,7 @@ function assertMenuLinkParents($links, $expected_hierarchy) {
 
       $menu_link = menu_link_load($mlid);
       menu_link_save($menu_link);
-      $this->assertEqual($menu_link['plid'], $plid, format_string('Menu link %mlid has parent of %plid, expected %expected_plid.', array('%mlid' => $mlid, '%plid' => $menu_link['plid'], '%expected_plid' => $plid)));
+      $this->assertEqual($menu_link['plid'], $plid, String::format('Menu link %mlid has parent of %plid, expected %expected_plid.', array('%mlid' => $mlid, '%plid' => $menu_link['plid'], '%expected_plid' => $plid)));
     }
   }
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php
index 5de7b58..b1a3f83 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Menu;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -42,7 +43,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/lib/Drupal/system/Tests/Menu/MenuRouterTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php
index 03f8ca1..c482d77 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Menu;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -273,7 +274,7 @@ protected function menuItemTitlesCasesHelper($case_no, $override = FALSE) {
     $this->drupalGet('menu-title-test/case' . $case_no);
     $this->assertResponse(200);
     $asserted_title = $override ? 'Alternative example title - Case ' . $case_no : 'Example title - Case ' . $case_no;
-    $this->assertTitle($asserted_title . ' | Drupal', format_string('Menu title is: %title.', array('%title' => $asserted_title)), 'Menu');
+    $this->assertTitle($asserted_title . ' | Drupal', String::format('Menu title is: %title.', array('%title' => $asserted_title)), 'Menu');
   }
 
   /**
diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuTestBase.php
index d205b13..4128ad1 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuTestBase.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Menu;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 abstract class MenuTestBase extends WebTestBase {
@@ -65,13 +66,13 @@ protected function assertBreadcrumbParts($trail) {
       foreach ($trail as $path => $title) {
         $url = url($path);
         $part = array_shift($parts);
-        $pass = ($pass && $part['href'] === $url && $part['text'] === check_plain($title));
+        $pass = ($pass && $part['href'] === $url && $part['text'] === String::checkPlain($title));
       }
     }
     // 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(),
     )));
@@ -124,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/lib/Drupal/system/Tests/Module/InstallTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php
index eaa2fc9..6f099d7 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php
+++ b/core/modules/system/lib/Drupal/system/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;
 
@@ -66,7 +67,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);
@@ -76,7 +77,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/lib/Drupal/system/Tests/Module/ModuleApiTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php
index d35ddab..81c610a 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Module;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -77,7 +78,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)));
   }
 
   /**
@@ -179,7 +180,7 @@ function testDependencyResolution() {
     $result = module_uninstall(array('ban', 'xmlrpc', 'forum'));
     $this->assertTrue($result, 'module_uninstall() returns the correct value.');
     foreach (array('forum', 'ban', 'xmlrpc') as $module) {
-      $this->assertEqual(drupal_get_installed_schema_version($module), SCHEMA_UNINSTALLED, format_string('The @module module was uninstalled.', array('@module' => $module)));
+      $this->assertEqual(drupal_get_installed_schema_version($module), SCHEMA_UNINSTALLED, String::format('The @module module was uninstalled.', array('@module' => $module)));
     }
     $uninstalled_modules = \Drupal::state()->get('module_test.uninstall_order') ?: array();
     $this->assertEqual($uninstalled_modules, array('forum', 'ban', 'xmlrpc'), 'Modules were uninstalled in the correct order by module_uninstall().');
diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php
index 12ee30c..fdb8879 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Module;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Config\FileStorage;
 use Drupal\simpletest\WebTestBase;
@@ -45,9 +46,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)));
   }
 
   /**
@@ -65,7 +66,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)));
   }
 
   /**
@@ -82,7 +83,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)));
   }
 
   /**
@@ -124,7 +125,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)));
   }
 
   /**
@@ -138,7 +139,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)));
   }
 
   /**
@@ -158,7 +159,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)));
     }
   }
 
@@ -193,6 +194,6 @@ function assertLogMessage($type, $message, $variables = array(), $severity = WAT
       ->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/lib/Drupal/system/Tests/Module/RequiredTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/RequiredTest.php
index 1de4535..45af737 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Module/RequiredTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Module/RequiredTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\system\Tests\Module;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Test required modules functionality.
  */
@@ -31,7 +33,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/lib/Drupal/system/Tests/Path/AliasTest.php b/core/modules/system/lib/Drupal/system/Tests/Path/AliasTest.php
index 5f5d368..8c76df4 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Path/AliasTest.php
+++ b/core/modules/system/lib/Drupal/system/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\Path;
 use Drupal\Core\Database\Database;
@@ -43,7 +44,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;
@@ -53,7 +54,7 @@ function testCRUD() {
     foreach ($aliases as $alias) {
       $pid = $alias['pid'];
       $loadedAlias = $path->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)));
     }
 
     //Update a few aliases
@@ -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/lib/Drupal/system/Tests/Path/MatchPathTest.php b/core/modules/system/lib/Drupal/system/Tests/Path/MatchPathTest.php
index 4adb5cf..3b5ef35 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Path/MatchPathTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Path/MatchPathTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Path;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -45,7 +46,7 @@ function testDrupalMatchPath() {
     foreach ($tests as $patterns => $cases) {
       foreach ($cases as $path => $expected_result) {
         $actual_result = drupal_match_path($path, $patterns);
-        $this->assertIdentical($actual_result, $expected_result, format_string('Tried matching the path <code>@path</code> to the pattern <pre>@patterns</pre> - expected @expected, got @actual.', array('@path' => $path, '@patterns' => $patterns, '@expected' => var_export($expected_result, TRUE), '@actual' => var_export($actual_result, TRUE))));
+        $this->assertIdentical($actual_result, $expected_result, String::format('Tried matching the path <code>@path</code> to the pattern <pre>@patterns</pre> - expected @expected, got @actual.', array('@path' => $path, '@patterns' => $patterns, '@expected' => var_export($expected_result, TRUE), '@actual' => var_export($actual_result, TRUE))));
       }
     }
   }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php b/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php
index 35a4ef7..f6a5360 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Path;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -104,7 +105,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)));
   }
 
   /**
@@ -120,6 +121,6 @@ protected function assertUrlOutboundAlter($original, $final) {
   protected function assertUrlInboundAlter($original, $final) {
     // Test inbound altering.
     $result = $this->container->get('path.alias_manager')->getSystemPath($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/lib/Drupal/system/Tests/Plugin/CacheDecoratorLanguageTest.php b/core/modules/system/lib/Drupal/system/Tests/Plugin/CacheDecoratorLanguageTest.php
index 43d8532..21df3d8 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Plugin/CacheDecoratorLanguageTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Plugin/CacheDecoratorLanguageTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Plugin;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 use Drupal\plugin_test\Plugin\CachedMockBlockManager;
 use Drupal\simpletest\WebTestBase;
@@ -99,15 +100,15 @@ public function testCacheDecoratorLanguage() {
     $languages[] = 'en';
     foreach ($languages as $langcode) {
       $cache = \Drupal::cache()->get('mock_block:' . $langcode);
-      $this->assertEqual($cache->cid, 'mock_block:' . $langcode, format_string('The !cache cache exists.', array('!cache' => 'mock_block:' . $langcode)));
-      $this->assertEqual($cache->expire, 1542646800, format_string('The cache expiration was properly set.'));
+      $this->assertEqual($cache->cid, 'mock_block:' . $langcode, String::format('The !cache cache exists.', array('!cache' => 'mock_block:' . $langcode)));
+      $this->assertEqual($cache->expire, 1542646800, String::format('The cache expiration was properly set.'));
     }
     // Clear the plugin definitions.
     $manager = new CachedMockBlockManager();
     $manager->clearCachedDefinitions();
     foreach ($languages as $langcode) {
       $cache = \Drupal::cache()->get('mock_block:' . $langcode);
-      $this->assertFalse($cache, format_string('The !cache cache was properly cleared through the cache::deleteTags() method.', array('!cache' => 'mock_block:' . $langcode)));
+      $this->assertFalse($cache, String::format('The !cache cache was properly cleared through the cache::deleteTags() method.', array('!cache' => 'mock_block:' . $langcode)));
     }
     // Change the translations for the german language and recheck strings.
     $custom_strings = array();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php b/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php
index 16d3eec..371e272 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Session;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 class SessionTest extends WebTestBase {
@@ -67,7 +68,7 @@ function testSessionSaveRegenerate() {
     );
     $this->drupalPostForm('user', $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/lib/Drupal/system/Tests/System/ErrorHandlerTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php
index 2356a84..dfe7ffb 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\System;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -120,10 +121,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.
@@ -135,7 +136,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)));
   }
 
   /**
@@ -143,6 +144,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/lib/Drupal/system/Tests/System/PageTitleTest.php b/core/modules/system/lib/Drupal/system/Tests/System/PageTitleTest.php
index fdc511a..8eebe85 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/PageTitleTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/PageTitleTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\System;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Utility\Title;
 use Drupal\simpletest\WebTestBase;
 
@@ -61,7 +62,7 @@ function testTitleTags() {
     $node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
     $this->assertNotNull($node, 'Node created and found in database');
     $this->drupalGet("node/" . $node->id());
-    $this->assertText(check_plain($edit['title[0][value]']), 'Check to make sure tags in the node title are converted.');
+    $this->assertText(String::checkPlain($edit['title[0][value]']), 'Check to make sure tags in the node title are converted.');
   }
 
   /**
@@ -70,7 +71,7 @@ function testTitleTags() {
   function testTitleXSS() {
     // Set some title with JavaScript and HTML chars to escape.
     $title = '</title><script type="text/javascript">alert("Title XSS!");</script> & < > " \' ';
-    $title_filtered = check_plain($title);
+    $title_filtered = String::checkPlain($title);
 
     $slogan = '<script type="text/javascript">alert("Slogan XSS!");</script>';
     $slogan_filtered = filter_xss_admin($slogan);
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormTestBase.php b/core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormTestBase.php
index b923daf..4715acf 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormTestBase.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\System;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -60,7 +61,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/lib/Drupal/system/Tests/System/TokenReplaceUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceUnitTest.php
index 623d995..b6edcc3 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceUnitTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceUnitTest.php
@@ -46,7 +46,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->languageInterface->id));
-      $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.
@@ -112,7 +112,7 @@ public function testSystemSiteTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $this->tokenService->replace($input, array(), array('langcode' => $this->languageInterface->id));
-      $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.
@@ -121,7 +121,7 @@ public function testSystemSiteTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $this->tokenService->replace($input, array(), array('langcode' => $this->languageInterface->id, '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
@@ -158,7 +158,7 @@ public function testSystemDateTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $this->tokenService->replace($input, array('date' => $date), array('langcode' => $this->languageInterface->id));
-      $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/lib/Drupal/system/Tests/Theme/FunctionsTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php
index 7aa294c..c1b0433 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Theme;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Session\UserSession;
 use Drupal\simpletest\WebTestBase;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
@@ -198,10 +199,10 @@ function testLinks() {
 
     $expected_links = '';
     $expected_links .= '<ul id="somelinks">';
-    $expected_links .= '<li class="a-link"><a href="' . url('a/link') . '">' . check_plain('A <link>') . '</a></li>';
-    $expected_links .= '<li class="plain-text">' . check_plain('Plain "text"') . '</li>';
-    $expected_links .= '<li class="front-page"><a href="' . url('<front>') . '">' . check_plain('Front page') . '</a></li>';
-    $expected_links .= '<li class="router-test"><a href="' . \Drupal::urlGenerator()->generate('router_test.1') . '">' . check_plain('Test route') . '</a></li>';
+    $expected_links .= '<li class="a-link"><a href="' . url('a/link') . '">' . String::checkPlain('A <link>') . '</a></li>';
+    $expected_links .= '<li class="plain-text">' . String::checkPlain('Plain "text"') . '</li>';
+    $expected_links .= '<li class="front-page"><a href="' . url('<front>') . '">' . String::checkPlain('Front page') . '</a></li>';
+    $expected_links .= '<li class="router-test"><a href="' . \Drupal::urlGenerator()->generate('router_test.1') . '">' . String::checkPlain('Test route') . '</a></li>';
     $expected_links .= '</ul>';
 
     // Verify that passing a string as heading works.
@@ -234,10 +235,10 @@ function testLinks() {
     );
     $expected_links = '';
     $expected_links .= '<ul id="somelinks">';
-    $expected_links .= '<li class="a-link"><a href="' . url('a/link') . '" class="a/class">' . check_plain('A <link>') . '</a></li>';
-    $expected_links .= '<li class="plain-text"><span class="a/class">' . check_plain('Plain "text"') . '</span></li>';
-    $expected_links .= '<li class="front-page"><a href="' . url('<front>') . '">' . check_plain('Front page') . '</a></li>';
-    $expected_links .= '<li class="router-test"><a href="' . \Drupal::urlGenerator()->generate('router_test.1') . '">' . check_plain('Test route') . '</a></li>';
+    $expected_links .= '<li class="a-link"><a href="' . url('a/link') . '" class="a/class">' . String::checkPlain('A <link>') . '</a></li>';
+    $expected_links .= '<li class="plain-text"><span class="a/class">' . String::checkPlain('Plain "text"') . '</span></li>';
+    $expected_links .= '<li class="front-page"><a href="' . url('<front>') . '">' . String::checkPlain('Front page') . '</a></li>';
+    $expected_links .= '<li class="router-test"><a href="' . \Drupal::urlGenerator()->generate('router_test.1') . '">' . String::checkPlain('Test route') . '</a></li>';
     $expected_links .= '</ul>';
     $expected = $expected_heading . $expected_links;
     $this->assertThemeOutput('links', $variables, $expected);
@@ -247,10 +248,10 @@ function testLinks() {
     $variables['set_active_class'] = TRUE;
     $expected_links = '';
     $expected_links .= '<ul id="somelinks">';
-    $expected_links .= '<li class="a-link" data-drupal-link-system-path="a/link"><a href="' . url('a/link') . '" class="a/class" data-drupal-link-system-path="a/link">' . check_plain('A <link>') . '</a></li>';
-    $expected_links .= '<li class="plain-text"><span class="a/class">' . check_plain('Plain "text"') . '</span></li>';
-    $expected_links .= '<li class="front-page" data-drupal-link-system-path="&lt;front&gt;"><a href="' . url('<front>') . '" data-drupal-link-system-path="&lt;front&gt;">' . check_plain('Front page') . '</a></li>';
-    $expected_links .= '<li class="router-test" data-drupal-link-system-path="router_test/test1"><a href="' . \Drupal::urlGenerator()->generate('router_test.1') . '" data-drupal-link-system-path="router_test/test1">' . check_plain('Test route') . '</a></li>';
+    $expected_links .= '<li class="a-link" data-drupal-link-system-path="a/link"><a href="' . url('a/link') . '" class="a/class" data-drupal-link-system-path="a/link">' . String::checkPlain('A <link>') . '</a></li>';
+    $expected_links .= '<li class="plain-text"><span class="a/class">' . String::checkPlain('Plain "text"') . '</span></li>';
+    $expected_links .= '<li class="front-page" data-drupal-link-system-path="&lt;front&gt;"><a href="' . url('<front>') . '" data-drupal-link-system-path="&lt;front&gt;">' . String::checkPlain('Front page') . '</a></li>';
+    $expected_links .= '<li class="router-test" data-drupal-link-system-path="router_test/test1"><a href="' . \Drupal::urlGenerator()->generate('router_test.1') . '" data-drupal-link-system-path="router_test/test1">' . String::checkPlain('Test route') . '</a></li>';
     $expected_links .= '</ul>';
     $expected = $expected_heading . $expected_links;
     $this->assertThemeOutput('links', $variables, $expected);
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php
index 76edbcd..ded73f8 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Theme;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 use Drupal\test_theme\ThemeClass;
 
@@ -66,7 +67,7 @@ function testThemeDataTypes() {
     $foos = array('null' => NULL, 'false' => FALSE, 'integer' => 1, 'string' => 'foo');
     foreach ($foos as $type => $example) {
       $output = _theme('theme_test_foo', array('foo' => $example));
-      $this->assertTrue(is_string($output), format_string('_theme() returns a string for data type !type.', array('!type' => $type)));
+      $this->assertTrue(is_string($output), String::format('_theme() returns a string for data type !type.', array('!type' => $type)));
     }
 
     // suggestionnotimplemented is not an implemented theme hook so _theme()
diff --git a/core/modules/system/lib/Drupal/system/Tests/Transliteration/TransliterationTest.php b/core/modules/system/lib/Drupal/system/Tests/Transliteration/TransliterationTest.php
index 2e5ed60..be57762 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Transliteration/TransliterationTest.php
+++ b/core/modules/system/lib/Drupal/system/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;
 
@@ -91,7 +92,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,
@@ -99,7 +100,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/system.api.php b/core/modules/system/system.api.php
index 4c95a00..2cab703 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -5,6 +5,7 @@
  * Hooks provided by Drupal core and the System module.
  */
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Utility\UpdateException;
 
 /**
@@ -2532,7 +2533,7 @@ function hook_tokens($type, $tokens, array $data = array(), array $options = arr
           break;
 
         case 'title':
-          $replacements[$original] = $sanitize ? check_plain($node->getTitle()) : $node->getTitle();
+          $replacements[$original] = $sanitize ? String::checkPlain($node->getTitle()) : $node->getTitle();
           break;
 
         case 'edit-url':
@@ -2542,7 +2543,7 @@ function hook_tokens($type, $tokens, array $data = array(), array $options = arr
         // Default values for the chained tokens handled below.
         case 'author':
           $account = $node->getOwner() ? $node->getOwner() : user_load(0);
-          $replacements[$original] = $sanitize ? check_plain($account->label()) : $account->label();
+          $replacements[$original] = $sanitize ? String::checkPlain($account->label()) : $account->label();
           break;
 
         case 'created':
diff --git a/core/modules/system/system.tokens.inc b/core/modules/system/system.tokens.inc
index 4c27e2c..05e35ac 100644
--- a/core/modules/system/system.tokens.inc
+++ b/core/modules/system/system.tokens.inc
@@ -7,6 +7,8 @@
  * This file handles tokens for the global 'site' and 'date' tokens.
  */
 
+use Drupal\Component\Utility\String;
+
 /**
  * Implements hook_token_info().
  */
@@ -104,7 +106,7 @@ function system_tokens($type, $tokens, array $data = array(), array $options = a
       switch ($name) {
         case 'name':
           $site_name = \Drupal::config('system.site')->get('name');
-          $replacements[$original] = $sanitize ? check_plain($site_name) : $site_name;
+          $replacements[$original] = $sanitize ? String::checkPlain($site_name) : $site_name;
           break;
 
         case 'slogan':
@@ -158,7 +160,7 @@ function system_tokens($type, $tokens, array $data = array(), array $options = a
           break;
 
         case 'raw':
-          $replacements[$original] = $sanitize ? check_plain($date) : $date;
+          $replacements[$original] = $sanitize ? String::checkPlain($date) : $date;
           break;
       }
     }
diff --git a/core/modules/system/tests/modules/database_test/database_test.module b/core/modules/system/tests/modules/database_test/database_test.module
index f41ad30..cb9da23 100644
--- a/core/modules/system/tests/modules/database_test/database_test.module
+++ b/core/modules/system/tests/modules/database_test/database_test.module
@@ -215,7 +215,7 @@ function database_test_theme_tablesort($form, &$form_state) {
   foreach (user_load_multiple($uids) as $account) {
     $options[$account->id()] = array(
       'title' => array('data' => array('#title' => String::checkPlain($account->getUsername()))),
-      'username' => check_plain($account->getUsername()),
+      'username' => String::checkPlain($account->getUsername()),
       'status' =>  $account->isActive() ? t('active') : t('blocked'),
     );
   }
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 9bc9682..054138c 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\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
@@ -382,7 +383,7 @@ function entity_test_entity_predelete(EntityInterface $entity) {
  */
 function entity_test_entity_operation_alter(array &$operations, EntityInterface $entity) {
   $operations['test_operation'] = array(
-    'title' => format_string('Test Operation: @label', array('@label' => $entity->label())),
+    'title' => String::format('Test Operation: @label', array('@label' => $entity->label())),
     'href' => $entity->url() . '/test_operation',
     'weight' => 50,
   );
diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestViewBuilder.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestViewBuilder.php
index 6805765..8f5efad 100644
--- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestViewBuilder.php
+++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestViewBuilder.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\entity_test;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityViewBuilder;
 
 /**
@@ -24,13 +25,13 @@ public function buildContent(array $entities, array $displays, $view_mode, $lang
 
     foreach ($entities as $entity) {
       $entity->content['label'] = array(
-        '#markup' => check_plain($entity->label()),
+        '#markup' => String::checkPlain($entity->label()),
       );
       $entity->content['separator'] = array(
         '#markup' => ' | ',
       );
       $entity->content['view_mode'] = array(
-        '#markup' => check_plain($view_mode),
+        '#markup' => String::checkPlain($view_mode),
       );
     }
   }
diff --git a/core/modules/system/tests/modules/form_test/form_test.module b/core/modules/system/tests/modules/form_test/form_test.module
index 43d5d25..47d189a 100644
--- a/core/modules/system/tests/modules/form_test/form_test.module
+++ b/core/modules/system/tests/modules/form_test/form_test.module
@@ -5,6 +5,7 @@
  * Helper module for the form API tests.
  */
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Json;
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Database\Database;
@@ -643,7 +644,7 @@ function form_storage_test_form_continue_submit($form, &$form_state) {
  * Form submit handler to finish multi-step form.
  */
 function form_test_storage_form_submit($form, &$form_state) {
-  drupal_set_message("Title: " . check_plain($form_state['values']['title']));
+  drupal_set_message("Title: " . String::checkPlain($form_state['values']['title']));
   drupal_set_message("Form constructions: " . $_SESSION['constructions']);
   if (isset($form_state['storage']['thing']['changed'])) {
     drupal_set_message("The thing has been changed.");
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/EfqTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/EfqTest.php
index e664f67..912e510 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/EfqTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/EfqTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\taxonomy\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\Query\QueryFactory;
 
 /**
@@ -61,7 +62,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/lib/Drupal/taxonomy/Tests/LoadMultipleTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/LoadMultipleTest.php
index 2c538fe..a6c4d6b 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/LoadMultipleTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/LoadMultipleTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\taxonomy\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Test the entity_load_multiple() function.
  */
@@ -43,7 +45,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 = entity_load_multiple('taxonomy_term', array_keys($terms));
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php
index 23c0781..fd080c9 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php
@@ -214,28 +214,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->randomName();
     $tag = $this->randomName();
     $message = t("Taxonomy field @field_name not found.", array('@field_name' => $field_name));
-    $this->assertFalse(field_info_field('node', $field_name), format_string('Field %field_name does not exist.', array('%field_name' => $field_name)));
+    $this->assertFalse(field_info_field('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/lib/Drupal/taxonomy/Tests/TermValidationTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermValidationTest.php
index 737f662..24f4bd2 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermValidationTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermValidationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\taxonomy\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\system\Tests\Entity\EntityUnitTestBase;
 
 /**
@@ -69,6 +70,6 @@ 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('%id is not a valid parent for this term.', array('%id' => 9999)));
+    $this->assertEqual($violations[0]->getMessage(), String::format('%id is not a valid parent for this term.', array('%id' => 9999)));
   }
 }
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TokenReplaceTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TokenReplaceTest.php
index d3a938b..23cfe8c 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TokenReplaceTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TokenReplaceTest.php
@@ -97,7 +97,7 @@ function testTaxonomyTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('term' => $term1), array('langcode' => $language_interface->id));
-      $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.
@@ -117,7 +117,7 @@ function testTaxonomyTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('term' => $term2), array('langcode' => $language_interface->id));
-      $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.
@@ -128,7 +128,7 @@ function testTaxonomyTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('term' => $term2), array('langcode' => $language_interface->id, '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.
@@ -144,7 +144,7 @@ function testTaxonomyTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('vocabulary' => $this->vocabulary), array('langcode' => $language_interface->id));
-      $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.
@@ -153,8 +153,7 @@ function testTaxonomyTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('vocabulary' => $this->vocabulary), array('langcode' => $language_interface->id, '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/lib/Drupal/text/Plugin/Field/FieldType/TextItemBase.php b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextItemBase.php
index fe704c2..bfdfe57 100644
--- a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextItemBase.php
+++ b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextItemBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\text\Plugin\Field\FieldType;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldItemBase;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\PrepareCacheInterface;
@@ -50,7 +51,7 @@ public static function propertyDefinitions(FieldDefinitionInterface $field_defin
    * {@inheritdoc}
    */
   public function applyDefaultValue($notify = TRUE) {
-    // Default to a simple check_plain().
+    // Default to a simple String::checkPlain().
     // @todo: Add in the filter default format here.
     $this->setValue(array('format' => NULL), $notify);
     return $this;
diff --git a/core/modules/text/lib/Drupal/text/Tests/Formatter/TextPlainUnitTest.php b/core/modules/text/lib/Drupal/text/Tests/Formatter/TextPlainUnitTest.php
index 8e37920..5a3a5ff 100644
--- a/core/modules/text/lib/Drupal/text/Tests/Formatter/TextPlainUnitTest.php
+++ b/core/modules/text/lib/Drupal/text/Tests/Formatter/TextPlainUnitTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\text\Tests\Formatter;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
 use Drupal\Core\Language\Language;
@@ -130,7 +131,7 @@ protected function renderEntityFields(ContentEntityInterface $entity, EntityView
   /**
    * Formats an assertion message string.
    *
-   * Unlike format_string(),
+   * Unlike \Drupal\Component\Utility\String::format(),
    * - all replacement tokens are exported via var_export() and sanitized for
    *   output, regardless of token type used (i.e., '@', '!', and '%' do not
    *   have any special meaning).
@@ -145,8 +146,8 @@ protected function renderEntityFields(ContentEntityInterface $entity, EntityView
    * @return string
    *   The $message with exported replacement tokens, sanitized for HTML output.
    *
-   * @see check_plain()
-   * @see format_string()
+   * @see \Drupal\Component\Utility\String::checkPlain()
+   * @see \Drupal\Component\Utility\String::format()
    */
   protected function formatString($message, array $args) {
     array_walk($args, function (&$value) {
@@ -305,7 +306,7 @@ function testPlainText() {
     $this->renderEntityFields($entity, $this->display);
     $this->assertText($value);
     $this->assertNoRaw($value);
-    $this->assertRaw(nl2br(check_plain($value)));
+    $this->assertRaw(nl2br(String::checkPlain($value)));
   }
 
 }
diff --git a/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php b/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php
index aecf257..4f64402 100644
--- a/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php
+++ b/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\text\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -122,7 +123,7 @@ function _testTextfieldWidgets($field_type, $widget_type) {
     $this->drupalGet('entity_test/add');
     $this->assertFieldByName("{$this->field_name}[0][value]", '', 'Widget is displayed');
     $this->assertNoFieldByName("{$this->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->randomName();
@@ -215,7 +216,7 @@ function _testTextfieldWidgetsFormatted($field_type, $widget_type) {
     $content = $display->build($entity);
     $this->drupalSetContent(drupal_render($content));
     $this->assertNoRaw($value, 'HTML tags are not displayed.');
-    $this->assertRaw(check_plain($value), 'Escaped HTML is displayed correctly.');
+    $this->assertRaw(String::checkPlain($value), 'Escaped HTML is displayed correctly.');
 
     // Create a new text format that does not escape HTML, and grant the user
     // access to it.
diff --git a/core/modules/text/lib/Drupal/text/Tests/TextSummaryTest.php b/core/modules/text/lib/Drupal/text/Tests/TextSummaryTest.php
index b287a62..5026773 100644
--- a/core/modules/text/lib/Drupal/text/Tests/TextSummaryTest.php
+++ b/core/modules/text/lib/Drupal/text/Tests/TextSummaryTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\text\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\DrupalUnitTestBase;
 
 /**
@@ -218,7 +219,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/text/lib/Drupal/text/TextProcessed.php b/core/modules/text/lib/Drupal/text/TextProcessed.php
index 5d99de3..7dda0f3 100644
--- a/core/modules/text/lib/Drupal/text/TextProcessed.php
+++ b/core/modules/text/lib/Drupal/text/TextProcessed.php
@@ -49,7 +49,7 @@ public function getValue($langcode = NULL) {
     $item = $this->getParent();
     $text = $item->{($this->definition->getSetting('text source'))};
 
-    // Avoid running check_markup() or check_plain() on empty strings.
+    // Avoid running check_markup() or String::checkPlain() on empty strings.
     if (!isset($text) || $text === '') {
       $this->processed = '';
     }
diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module
index 29773f1..897a5c2 100644
--- a/core/modules/toolbar/toolbar.module
+++ b/core/modules/toolbar/toolbar.module
@@ -5,6 +5,7 @@
  * Administration toolbar for quick access to top level administration items.
  */
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Template\Attribute;
@@ -460,7 +461,7 @@ function toolbar_menu_navigation_links(&$tree) {
         'toolbar-icon',
         'toolbar-icon-' . strtolower(str_replace(' ', '-', $item['link']['link_title'])),
       ),
-      'title' => check_plain($item['link']['description']),
+      'title' => String::checkPlain($item['link']['description']),
     );
   }
 }
diff --git a/core/modules/tour/lib/Drupal/tour/Plugin/tour/tip/TipPluginText.php b/core/modules/tour/lib/Drupal/tour/Plugin/tour/tip/TipPluginText.php
index d883490..74ad089 100644
--- a/core/modules/tour/lib/Drupal/tour/Plugin/tour/tip/TipPluginText.php
+++ b/core/modules/tour/lib/Drupal/tour/Plugin/tour/tip/TipPluginText.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\tour\Plugin\tour\tip;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Utility\Token;
 use Drupal\tour\TipPluginBase;
@@ -118,7 +119,7 @@ public function getAttributes() {
    * Implements \Drupal\tour\TipPluginInterface::getOutput().
    */
   public function getOutput() {
-    $output = '<h2 class="tour-tip-label" id="tour-tip-' . $this->getAriaId() . '-label">' . check_plain($this->getLabel()) . '</h2>';
+    $output = '<h2 class="tour-tip-label" id="tour-tip-' . $this->getAriaId() . '-label">' . String::checkPlain($this->getLabel()) . '</h2>';
     $output .= '<p class="tour-tip-body" id="tour-tip-' . $this->getAriaId() . '-contents">' . filter_xss_admin($this->token->replace($this->getBody())) . '</p>';
     return array('#markup' => $output);
   }
diff --git a/core/modules/tour/lib/Drupal/tour/Tests/TourTestBase.php b/core/modules/tour/lib/Drupal/tour/Tests/TourTestBase.php
index 0beb7f0..1ba36ce 100644
--- a/core/modules/tour/lib/Drupal/tour/Tests/TourTestBase.php
+++ b/core/modules/tour/lib/Drupal/tour/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/tour/tests/tour_test/lib/Drupal/tour_test/Plugin/tour/tip/TipPluginImage.php b/core/modules/tour/tests/tour_test/lib/Drupal/tour_test/Plugin/tour/tip/TipPluginImage.php
index 79ed03c..89f051a 100644
--- a/core/modules/tour/tests/tour_test/lib/Drupal/tour_test/Plugin/tour/tip/TipPluginImage.php
+++ b/core/modules/tour/tests/tour_test/lib/Drupal/tour_test/Plugin/tour/tip/TipPluginImage.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\tour_test\Plugin\tour\tip;
 
+use Drupal\Component\Utility\String;
 use Drupal\tour\TipPluginBase;
 
 /**
@@ -44,7 +45,7 @@ public function getOutput() {
       '#uri' => $this->get('url'),
       '#alt' => $this->get('alt'),
     );
-    $output = '<h2 class="tour-tip-label" id="tour-tip-' . $this->get('ariaId') . '-label">' . check_plain($this->get('label')) . '</h2>';
+    $output = '<h2 class="tour-tip-label" id="tour-tip-' . $this->get('ariaId') . '-label">' . String::checkPlain($this->get('label')) . '</h2>';
     $output .= '<p class="tour-tip-image" id="tour-tip-' . $this->get('ariaId') . '-contents">' . drupal_render($image) . '</p>';
     return array('#markup' => $output);
   }
diff --git a/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php
index 001de20..2aab374 100644
--- a/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php
+++ b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\tracker\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\comment\CommentInterface;
 use Drupal\simpletest\WebTestBase;
 
@@ -261,7 +262,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');
@@ -271,7 +272,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/tracker/tracker.pages.inc b/core/modules/tracker/tracker.pages.inc
index 8922672..afeffe8 100644
--- a/core/modules/tracker/tracker.pages.inc
+++ b/core/modules/tracker/tracker.pages.inc
@@ -5,6 +5,8 @@
  * User page callbacks for tracker.module.
  */
 
+use Drupal\Component\Utility\String;
+
 
 /**
  * Page callback: Generates a page of tracked nodes for the site.
@@ -86,7 +88,7 @@ function tracker_page($account = NULL) {
       );
 
       $row = array(
-        'type' => check_plain(node_get_type_label($node)),
+        'type' => String::checkPlain(node_get_type_label($node)),
         'title' => array('data' => l($node->getTitle(), 'node/' . $node->id()) . ' ' . drupal_render($mark_build)),
         'author' => array('data' => array('#theme' => 'username', '#account' => $node->getOwner())),
         'replies' => array('class' => array('replies'), 'data' => $comments),
diff --git a/core/modules/update/update.manager.inc b/core/modules/update/update.manager.inc
index f5c1d8a..9a4f44a 100644
--- a/core/modules/update/update.manager.inc
+++ b/core/modules/update/update.manager.inc
@@ -36,6 +36,7 @@
  * root.
  */
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Updater\Updater;
 use Drupal\Core\FileTransfer\Local;
 use Symfony\Component\HttpFoundation\RedirectResponse;
@@ -108,14 +109,14 @@ function update_manager_update_form($form, $form_state = array(), $context) {
         $project_name = l($project['title'], $project['link']);
       }
       else {
-        $project_name = check_plain($project['title']);
+        $project_name = String::checkPlain($project['title']);
       }
     }
     elseif (!empty($project['info']['name'])) {
-      $project_name = check_plain($project['info']['name']);
+      $project_name = String::checkPlain($project['info']['name']);
     }
     else {
-      $project_name = check_plain($name);
+      $project_name = String::checkPlain($name);
     }
     if ($project['project_type'] == 'theme' || $project['project_type'] == 'theme-disabled') {
       $project_name .= ' ' . t('(Theme)');
diff --git a/core/modules/update/update.report.inc b/core/modules/update/update.report.inc
index 6a06cbe..f681d39 100644
--- a/core/modules/update/update.report.inc
+++ b/core/modules/update/update.report.inc
@@ -5,6 +5,8 @@
  * Code required only when rendering the available updates report.
  */
 
+use Drupal\Component\Utility\String;
+
 /**
  * Returns HTML for the project status report.
  *
@@ -83,7 +85,7 @@ function theme_update_report($variables) {
     $row = '<div class="version-status">';
     $update_status_label = array('#theme' => 'update_status_label', '#status' => $project['status']);
     $status_label = drupal_render($update_status_label);
-    $row .= !empty($status_label) ? $status_label : check_plain($project['reason']);
+    $row .= !empty($status_label) ? $status_label : String::checkPlain($project['reason']);
     $row .= '<span class="icon">' . drupal_render($icon) . '</span>';
     $row .= "</div>\n";
 
@@ -93,13 +95,13 @@ function theme_update_report($variables) {
         $row .= l($project['title'], $project['link']);
       }
       else {
-        $row .= check_plain($project['title']);
+        $row .= String::checkPlain($project['title']);
       }
     }
     else {
-      $row .= check_plain($project['name']);
+      $row .= String::checkPlain($project['name']);
     }
-    $row .= ' ' . check_plain($project['existing_version']);
+    $row .= ' ' . String::checkPlain($project['existing_version']);
     if ($project['install_type'] == 'dev' && !empty($project['datestamp'])) {
       $row .= ' <span class="version-date">(' . format_date($project['datestamp'], 'custom', 'Y-M-d') . ')</span>';
     }
@@ -201,8 +203,8 @@ function theme_update_report($variables) {
       $row .= '<div class="extra">' . "\n";
       foreach ($project['extra'] as $value) {
         $row .= '<div class="' . implode(' ', $value['class']) . '">';
-        $row .= check_plain($value['label']) . ': ';
-        $row .= drupal_placeholder($value['data']);
+        $row .= String::checkPlain($value['label']) . ': ';
+        $row .= String::placeholder($value['data']);
         $row .= "</div>\n";
       }
       $row .= "</div>\n";  // extra div.
@@ -245,7 +247,7 @@ function theme_update_report($variables) {
             break;
 
           default:
-            $base_themes[] = drupal_placeholder($base_theme);
+            $base_themes[] = String::placeholder($base_theme);
         }
       }
       $row .= t('Depends on: !basethemes', array('!basethemes' => implode(', ', $base_themes)));
diff --git a/core/modules/user/lib/Drupal/user/AccountFormController.php b/core/modules/user/lib/Drupal/user/AccountFormController.php
index ed4cc07..7f9d61a 100644
--- a/core/modules/user/lib/Drupal/user/AccountFormController.php
+++ b/core/modules/user/lib/Drupal/user/AccountFormController.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\ContentEntityFormController;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\Query\QueryFactory;
@@ -181,7 +182,7 @@ public function form(array $form, array &$form_state) {
       '#access' => $admin,
     );
 
-    $roles = array_map('check_plain', user_role_names(TRUE));
+    $roles = array_map('String::checkPlain', user_role_names(TRUE));
     // The disabled checkbox subelement for the 'authenticated user' role
     // must be generated separately and added to the checkboxes element,
     // because of a limitation in Form API not supporting a single disabled
diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/access/Role.php b/core/modules/user/lib/Drupal/user/Plugin/views/access/Role.php
index a50ac39..496c9d7 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/access/Role.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/access/Role.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Plugin\views\access;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Plugin\views\access\AccessPluginBase;
 use Symfony\Component\Routing\Route;
 use Drupal\Core\Session\AccountInterface;
@@ -56,7 +57,7 @@ public function summaryTitle() {
     else {
       $rids = user_role_names();
       $rid = reset($this->options['role']);
-      return check_plain($rids[$rid]);
+      return String::checkPlain($rids[$rid]);
     }
   }
 
diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/argument_validator/User.php b/core/modules/user/lib/Drupal/user/Plugin/views/argument_validator/User.php
index 30489ab..272a04a 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/argument_validator/User.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/argument_validator/User.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Plugin\views\argument_validator;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\views\Plugin\views\argument_validator\Entity;
@@ -62,7 +63,7 @@ public function buildOptionsForm(&$form, &$form_state) {
     $form['roles'] = array(
       '#type' => 'checkboxes',
       '#title' => $this->t('Restrict to the selected roles'),
-      '#options' => array_map('check_plain', user_role_names(TRUE)),
+      '#options' => array_map('String::checkPlain', user_role_names(TRUE)),
       '#default_value' => $this->options['roles'],
       '#description' => $this->t('If no roles are selected, users from any role will be allowed.'),
       '#states' => array(
diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/field/Name.php b/core/modules/user/lib/Drupal/user/Plugin/views/field/Name.php
index 765a4d7..fa924d7 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/field/Name.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/field/Name.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Plugin\views\field;
 
+use Drupal\Component\Utility\String;
 use Drupal\user\Plugin\views\field\User;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ResultRow;
@@ -84,7 +85,7 @@ protected function renderLink($data, ResultRow $values) {
     if (!empty($this->options['link_to_user']) || !empty($this->options['overwrite_anonymous'])) {
       if (!empty($this->options['overwrite_anonymous']) && !$account->id()) {
         // This is an anonymous user, and we're overriting the text.
-        return check_plain($this->options['anonymous_text']);
+        return String::checkPlain($this->options['anonymous_text']);
       }
       elseif (!empty($this->options['link_to_user'])) {
         $account->name = $this->getValue($values);
diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/field/Roles.php b/core/modules/user/lib/Drupal/user/Plugin/views/field/Roles.php
index 55446b4..2569e9d 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/field/Roles.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/field/Roles.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Plugin\views\field;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Database\Connection;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\ViewExecutable;
@@ -80,7 +81,7 @@ public function preRender(&$values) {
       $roles = user_roles();
       $result = $this->database->query('SELECT u.uid, u.rid FROM {users_roles} u WHERE u.uid IN (:uids) AND u.rid IN (:rids)', array(':uids' => $uids, ':rids' => array_keys($roles)));
       foreach ($result as $role) {
-        $this->items[$role->uid][$role->rid]['role'] = check_plain($roles[$role->rid]->label());
+        $this->items[$role->uid][$role->rid]['role'] = String::checkPlain($roles[$role->rid]->label());
         $this->items[$role->uid][$role->rid]['rid'] = $role->rid;
       }
       // Sort the roles for each user by role weight.
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php b/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php
index de8062e..3423f62 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -51,9 +52,9 @@ function testUserAutocomplete() {
     $anonymous_name = $this->randomString() . '<script>alert();</script>';
     \Drupal::config('user.settings')->set('anonymous', $anonymous_name)->save();
     // Test that anonymous username is in the result when requested and escaped
-    // with check_plain().
+    // with String::checkPlain().
     $users = $this->drupalGetJSON('user/autocomplete/anonymous', array('query' => array('q' => drupal_substr($anonymous_name, 0, 4))));
-    $this->assertEqual(check_plain($anonymous_name), $users[0]['label'], 'The anonymous name found in autocompletion results.');
+    $this->assertEqual(String::checkPlain($anonymous_name), $users[0]['label'], 'The anonymous name found in autocompletion results.');
     $users = $this->drupalGetJSON('user/autocomplete', array('query' => array('q' => drupal_substr($anonymous_name, 0, 4))));
     $this->assertTrue(empty($users), 'The anonymous name not found in autocompletion results without enabling anonymous username.');
   }
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserDeleteTest.php b/core/modules/user/lib/Drupal/user/Tests/UserDeleteTest.php
index 92746c8..075e4fe 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserDeleteTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserDeleteTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -57,8 +58,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/lib/Drupal/user/Tests/UserRegistrationTest.php b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php
index ee84db2..d71515e 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Language\Language;
 use Drupal\simpletest\WebTestBase;
@@ -277,9 +278,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/lib/Drupal/user/Tests/UserTokenReplaceTest.php b/core/modules/user/lib/Drupal/user/Tests/UserTokenReplaceTest.php
index 991ac35..4c963ea 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserTokenReplaceTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserTokenReplaceTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 use Drupal\Core\Language\Language;
 
@@ -62,22 +63,22 @@ function testUserTokenReplacement() {
     // Generate and test sanitized tokens.
     $tests = array();
     $tests['[user:uid]'] = $account->id();
-    $tests['[user:name]'] = check_plain(user_format_name($account));
-    $tests['[user:mail]'] = check_plain($account->getEmail());
+    $tests['[user:name]'] = String::checkPlain(user_format_name($account));
+    $tests['[user:mail]'] = String::checkPlain($account->getEmail());
     $tests['[user:url]'] = url("user/" . $account->id(), $url_options);
     $tests['[user:edit-url]'] = url("user/" . $account->id() . "/edit", $url_options);
     $tests['[user:last-login]'] = format_date($account->getLastLoginTime(), 'medium', '', NULL, $language_interface->id);
     $tests['[user:last-login:short]'] = format_date($account->getLastLoginTime(), 'short', '', NULL, $language_interface->id);
     $tests['[user:created]'] = format_date($account->getCreatedTime(), 'medium', '', NULL, $language_interface->id);
     $tests['[user:created:short]'] = format_date($account->getCreatedTime(), 'short', '', NULL, $language_interface->id);
-    $tests['[current-user:name]'] = check_plain(user_format_name($global_account));
+    $tests['[current-user:name]'] = String::checkPlain(user_format_name($global_account));
 
     // Test to make sure that we generated something for each token.
     $this->assertFalse(in_array(0, array_map('strlen', $tests)), 'No empty tokens generated.');
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('user' => $account), array('langcode' => $language_interface->id));
-      $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.
@@ -87,7 +88,7 @@ function testUserTokenReplacement() {
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('user' => $account), array('langcode' => $language_interface->id, '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/user/user.module b/core/modules/user/user.module
index 0ed9aa1..c56209e 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -1,5 +1,6 @@
 <?php
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\Crypt;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Entity\EntityInterface;
@@ -568,9 +569,9 @@ function user_preprocess_block(&$variables) {
  *   The account object for the user whose name is to be formatted.
  *
  * @return
- *   An unsanitized string with the username to display. The code receiving
- *   this result must ensure that check_plain() is called on it before it is
- *   printed to the page.
+ *   An unsanitized string with the username to display. The code receiving this
+ *   result must ensure that \Drupal\Component\Utility\String::checkPlain() is
+ *   called on it before it is printed to the page.
  *
  * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
  *   Use \Drupal\Core\Session\Interface::getUsername().
@@ -607,7 +608,7 @@ function user_template_preprocess_default_variables_alter(&$variables) {
  *
  * Modules that make any changes to variables like 'name' or 'extra' must ensure
  * that the final string is safe to include directly in the output by using
- * check_plain() or filter_xss().
+ * \Drupal\Component\Utility\String::checkPlain() or filter_xss().
  */
 function template_preprocess_username(&$variables) {
   $account = $variables['account'] ?: new AnonymousUserSession();
@@ -633,7 +634,7 @@ function template_preprocess_username(&$variables) {
   else {
     $variables['truncated'] = FALSE;
   }
-  $variables['name'] = check_plain($name);
+  $variables['name'] = String::checkPlain($name);
   $variables['profile_access'] = \Drupal::currentUser()->hasPermission('access user profiles');
 
   // Populate link path and attributes if appropriate.
@@ -650,7 +651,7 @@ function template_preprocess_username(&$variables) {
     $variables['link_path'] = $account->homepage;
     $variables['homepage'] = $account->homepage;
   }
-  // We do not want the l() function to check_plain() a second time.
+  // We do not want the l() function to String::checkPlain() a second time.
   $variables['link_options']['html'] = TRUE;
   // Set a default class.
   $variables['link_options']['attributes']['class'] = array('username');
diff --git a/core/modules/user/user.tokens.inc b/core/modules/user/user.tokens.inc
index e3c22f2..ed87f64 100644
--- a/core/modules/user/user.tokens.inc
+++ b/core/modules/user/user.tokens.inc
@@ -5,6 +5,8 @@
  * Builds placeholder replacement tokens for user-related data.
  */
 
+use Drupal\Component\Utility\String;
+
 /**
  * Implements hook_token_info().
  */
@@ -88,11 +90,11 @@ function user_tokens($type, $tokens, array $data = array(), array $options = arr
 
         case 'name':
           $name = user_format_name($account);
-          $replacements[$original] = $sanitize ? check_plain($name) : $name;
+          $replacements[$original] = $sanitize ? String::checkPlain($name) : $name;
           break;
 
         case 'mail':
-          $replacements[$original] = $sanitize ? check_plain($account->getEmail()) : $account->getEmail();
+          $replacements[$original] = $sanitize ? String::checkPlain($account->getEmail()) : $account->getEmail();
           break;
 
         case 'url':
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php
index 3ebd71c..20af27b 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\query;
 
+use Drupal\Component\Utility\String;
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Database\Database;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -1441,7 +1442,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/lib/Drupal/views/Tests/DefaultViewsTest.php b/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php
index 6e74149..16314ce 100644
--- a/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\comment\CommentInterface;
 use Drupal\Core\Language\Language;
 use Drupal\simpletest\WebTestBase;
@@ -139,14 +140,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/lib/Drupal/views/Tests/Handler/AreaEntityTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php
index 5751042..ea1f4f5 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php
+++ b/core/modules/views/lib/Drupal/views/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\Language\Language;
 use Drupal\views\Tests\ViewTestBase;
@@ -60,9 +61,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) {
@@ -71,7 +72,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/lib/Drupal/views/Tests/Handler/FieldCounterTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldCounterTest.php
index 3d12d42..12a9cf8 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldCounterTest.php
+++ b/core/modules/views/lib/Drupal/views/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;
 
@@ -57,11 +58,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();
@@ -85,13 +86,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/lib/Drupal/views/Tests/Handler/FieldUnitTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldUnitTest.php
index e7f780c..fd808e3 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldUnitTest.php
+++ b/core/modules/views/lib/Drupal/views/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;
@@ -100,8 +101,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
@@ -124,8 +126,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
@@ -201,7 +204,7 @@ public function testFieldTokens() {
     $random_text = $this->randomName();
     $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/lib/Drupal/views/Tests/Handler/FieldWebTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldWebTest.php
index dc9e3e8..4ee1c0e 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldWebTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldWebTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests\Handler;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 
 /**
@@ -484,12 +485,12 @@ public function testTextRendering() {
     $trimmed_name = drupal_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;
@@ -531,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/lib/Drupal/views/Tests/Handler/HandlerAllTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerAllTest.php
index 08fdb76..288eae8 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerAllTest.php
+++ b/core/modules/views/lib/Drupal/views/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;
@@ -102,7 +103,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/lib/Drupal/views/Tests/ModuleTest.php b/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php
index e938a58..11060ee 100644
--- a/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php
@@ -93,7 +93,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(
@@ -101,7 +101,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() {
       'optional' => FALSE,
     );
     $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(
diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/FilterTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/FilterTest.php
index 77ad92e..41965d9 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Plugin/FilterTest.php
+++ b/core/modules/views/lib/Drupal/views/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;
 
@@ -96,7 +97,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();
 
@@ -122,7 +123,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();
@@ -146,7 +147,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/lib/Drupal/views/Tests/Plugin/RowEntityTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/RowEntityTest.php
index 5fa35b8..acb5df4 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Plugin/RowEntityTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/RowEntityTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests\Plugin;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 use Drupal\views\Tests\ViewUnitTestBase;
 
@@ -88,8 +89,9 @@ public function testEntityRow() {
    *   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
diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleMappingTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleMappingTest.php
index eb3fdea..b929e63 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleMappingTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleMappingTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests\Plugin;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 
 /**
@@ -79,7 +80,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/lib/Drupal/views/Tests/PluginInstanceTest.php b/core/modules/views/lib/Drupal/views/Tests/PluginInstanceTest.php
index e70bd1d..9f5a89d 100644
--- a/core/modules/views/lib/Drupal/views/Tests/PluginInstanceTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/PluginInstanceTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 
 /**
@@ -71,8 +72,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.
@@ -98,7 +99,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/lib/Drupal/views/Tests/QueryGroupByTest.php b/core/modules/views/lib/Drupal/views/Tests/QueryGroupByTest.php
index 7b7d0b7..51b541f 100644
--- a/core/modules/views/lib/Drupal/views/Tests/QueryGroupByTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/QueryGroupByTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 
 /**
@@ -98,8 +99,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/lib/Drupal/views/Tests/TokenReplaceTest.php b/core/modules/views/lib/Drupal/views/Tests/TokenReplaceTest.php
index 4b58fe0..c4f8aed 100644
--- a/core/modules/views/lib/Drupal/views/Tests/TokenReplaceTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/TokenReplaceTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 
 /**
@@ -61,7 +62,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/lib/Drupal/views/Tests/ViewExecutableTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php
index c0228ba..583f345 100644
--- a/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php
+++ b/core/modules/views/lib/Drupal/views/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;
@@ -128,7 +129,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.
@@ -427,7 +428,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/lib/Drupal/views/Tests/ViewStorageTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php
index af0341a..a706e53 100644
--- a/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php
+++ b/core/modules/views/lib/Drupal/views/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;
@@ -100,7 +101,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.
@@ -116,7 +117,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)));
       }
     }
 
@@ -135,7 +136,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.
@@ -152,8 +153,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.
@@ -226,14 +227,14 @@ protected function displayMethodTests() {
     $random_title = $this->randomName();
 
     $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->randomName();
     $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');
@@ -345,14 +346,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/lib/Drupal/views/Tests/ViewUnitTestBase.php b/core/modules/views/lib/Drupal/views/Tests/ViewUnitTestBase.php
index 620e4fe..f066eb3 100644
--- a/core/modules/views/lib/Drupal/views/Tests/ViewUnitTestBase.php
+++ b/core/modules/views/lib/Drupal/views/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/lib/Drupal/views/Tests/ViewsHooksTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewsHooksTest.php
index 2a90d11..063041a 100644
--- a/core/modules/views/lib/Drupal/views/Tests/ViewsHooksTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/ViewsHooksTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 
 /**
@@ -75,7 +76,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':
@@ -91,7 +92,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/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php
index 95658b3..a12a71a 100644
--- a/core/modules/views/lib/Drupal/views/ViewExecutable.php
+++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\DependencyInjection\DependencySerialization;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\views\Plugin\views\query\QueryPluginBase;
@@ -695,7 +696,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/lib/Drupal/views_ui/Tests/AnalyzeTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/AnalyzeTest.php
index 14cf275..d0d7673 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/AnalyzeTest.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/AnalyzeTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Tests\ViewTestBase;
 
 /**
@@ -60,7 +61,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/lib/Drupal/views_ui/Tests/CustomBooleanTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/CustomBooleanTest.php
index 1b40d9f..97a3ccb 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/CustomBooleanTest.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/CustomBooleanTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 
 /**
@@ -108,10 +109,9 @@ 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/lib/Drupal/views_ui/Tests/DefaultViewsTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DefaultViewsTest.php
index 607cfc1..dad19c1 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DefaultViewsTest.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DefaultViewsTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\views_ui\Tests;
 
+use Drupal\Component\Utility\String;
+
 /**
  * Tests enabling, disabling, and reverting default views via the listing page.
  */
@@ -205,7 +207,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/lib/Drupal/views_ui/Tests/DisplayAttachmentTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayAttachmentTest.php
index 5d71210..84f1929 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayAttachmentTest.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayAttachmentTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\views\Views;
 
 /**
@@ -42,7 +43,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/lib/Drupal/views_ui/Tests/DisplayTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php
index b3edc9a..1e5f763 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php
@@ -182,7 +182,7 @@ public function testPageContextualLinks() {
     $this->drupalGet('test-display');
     $id = 'views_ui_edit: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/lib/Drupal/views_ui/Tests/StorageTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/StorageTest.php
index 4a99d2a..f18ae21 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/StorageTest.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/StorageTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Language\Language;
 use Drupal\views\Views;
 
@@ -61,7 +62,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/lib/Drupal/views_ui/Tests/TagTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/TagTest.php
index db67fde..dd09ed9 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/TagTest.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/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;
 
@@ -59,7 +60,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/modules/xmlrpc/lib/Drupal/xmlrpc/Tests/XmlRpcMessagesTest.php b/core/modules/xmlrpc/lib/Drupal/xmlrpc/Tests/XmlRpcMessagesTest.php
index 637d7a2..b235707 100644
--- a/core/modules/xmlrpc/lib/Drupal/xmlrpc/Tests/XmlRpcMessagesTest.php
+++ b/core/modules/xmlrpc/lib/Drupal/xmlrpc/Tests/XmlRpcMessagesTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\xmlrpc\Tests;
 
+use Drupal\Component\Utility\String;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -39,7 +40,7 @@ function testSizedMessages() {
       $xml_message_l = xmlrpc_test_message_sized_in_kb($size);
       $xml_message_r = xmlrpc($xml_url, array('messages.messageSizedInKB' => array($size)));
 
-      $this->assertEqual($xml_message_l, $xml_message_r, format_string('XML-RPC messages.messageSizedInKB of %s Kb size received', array('%s' => $size)));
+      $this->assertEqual($xml_message_l, $xml_message_r, String::format('XML-RPC messages.messageSizedInKB of %s Kb size received', array('%s' => $size)));
     }
   }
 
diff --git a/core/modules/xmlrpc/xmlrpc.inc b/core/modules/xmlrpc/xmlrpc.inc
index 445993a..8f39217 100644
--- a/core/modules/xmlrpc/xmlrpc.inc
+++ b/core/modules/xmlrpc/xmlrpc.inc
@@ -11,6 +11,7 @@
  * This version is made available under the GNU GPL License
  */
 
+use Drupal\Component\Utility\String;
 use Guzzle\Http\Exception\BadResponseException;
 use Guzzle\Http\Exception\RequestException;
 
@@ -123,7 +124,7 @@ function xmlrpc_value_get_xml($xmlrpc_value) {
     case 'struct':
       $return = '<struct>' . "\n";
       foreach ($xmlrpc_value->data as $name => $value) {
-        $return .= "  <member><name>" . check_plain($name) . "</name><value>";
+        $return .= "  <member><name>" . String::checkPlain($name) . "</name><value>";
         $return .= xmlrpc_value_get_xml($value) . "</value></member>\n";
       }
       $return .= '</struct>';
diff --git a/core/themes/bartik/bartik.theme b/core/themes/bartik/bartik.theme
index 6b99f45..49631a2 100644
--- a/core/themes/bartik/bartik.theme
+++ b/core/themes/bartik/bartik.theme
@@ -5,6 +5,7 @@
  * Functions to support theming in the Bartik theme.
  */
 
+use Drupal\Component\Utility\String;
 use Drupal\Core\Template\RenderWrapper;
 use Drupal\Core\Template\Attribute;
 
@@ -175,7 +176,7 @@ function _bartik_process_page(&$variables) {
   $variables['hide_site_slogan'] = theme_get_setting('features.slogan') ? FALSE : TRUE;
   if ($variables['hide_site_name']) {
     // If toggle_name is FALSE, the site_name will be empty, so we rebuild it.
-    $variables['site_name'] = check_plain($site_config->get('name'));
+    $variables['site_name'] = String::checkPlain($site_config->get('name'));
   }
   if ($variables['hide_site_slogan']) {
     // If toggle_site_slogan is FALSE, the site_slogan will be empty, so we rebuild it.
diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme
index c0a5a08..9b7368f 100644
--- a/core/themes/seven/seven.theme
+++ b/core/themes/seven/seven.theme
@@ -120,7 +120,7 @@ function seven_node_add_list($variables) {
     $output = '<ul class="admin-list">';
     foreach ($content as $type) {
       $output .= '<li class="clearfix">';
-      $content = '<span class="label">' . check_plain($type->name) . '</span>';
+      $content = '<span class="label">' . String::checkPlain($type->name) . '</span>';
       $content .= '<div class="description">' . filter_xss_admin($type->description) . '</div>';
       $options['html'] = TRUE;
       $output .= l($content, 'node/add/' . $type->type, $options);
@@ -145,7 +145,7 @@ function seven_custom_block_add_list($variables) {
     $output = '<ul class="admin-list">';
     foreach ($variables['types'] as $id => $type) {
       $output .= '<li class="clearfix">';
-      $content = '<span class="label">' . check_plain($type['title']) . '</span>';
+      $content = '<span class="label">' . String::checkPlain($type['title']) . '</span>';
       $content .= '<div class="description">' . filter_xss_admin($type['description']) . '</div>';
       $options = $type['localized_options'];
       $options['html'] = TRUE;
