Alternative for FILTER_SANITIZE_STRING

$filter = filter_input( INPUT_GET, 'filter', FILTER_SANITIZE_STRING );
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( ! array_key_exists( 'filter', $_GET ) ) {
	return;
}

// phpcs:ignore WordPress.Security.NonceVerification.Recommended
return sanitize_text_field( wp_unslash( $_GET['filter'] ) );