checkplain() is deprecated in drupal 8

checkPlain() is deprecated in drupal 8 instead you can include 

use Drupal\Component\Utility\SafeMarkup;

SafeMarkup::checkPlain($string);