Render string

@param string $string
@return string
191502
public function simpleRender($string)
    {
        $paragraphs = '';

        foreach (explode("\n", $string) as $line) {
            if (trim($line)) {
                $paragraphs .= '<p>' . $line . '</p>';
            }
        }

        return $paragraphs;
    }
913424
protected function _respond( $string )
	{
		// if no view isset create one with the output buffer
		if ( is_null( $this->view ) ) 
		{
			$this->theme->content = $string;
		} else {
			$this->theme->content = $this->view->render();
		}
		
		// dont render the theme? Or does the request force render in modal?
		if ( CCRequest::current()->args->force_modal || $this->modal ) 
		{
			return CCResponse::create( $this->theme->content, $this->status );
		}
		
		// render theme and return response
		return CCResponse::create( $this->theme->render(), $this->status );
	}
199964
protected function escape(string $string): string
    {
        return htmlspecialchars($string, ENT_QUOTES | ENT_IGNORE, $this->encoding);
    }
517761
public function transform($string)
    {
        $string = preg_replace('/[^\p{L&}\p{Lo}\d]/u', $this->replacement, $string);
        $string = preg_replace('/[' . preg_quote($this->replacement) . ']+/u', $this->replacement, $string);
        $string = trim($string, $this->replacement);
        return $this->lowercase ? mb_strtolower($string) : $string;
    }
463785
private static function escape( $string )
	{
		$replace	= array(
			'\\'	=> '\\\\',
			'"'	=> '\"',
			'/'	=> '\/',
			"\b"	=> '\b',
			"\f"	=> '\f',
			"\n"	=> '\n',
			"\r"	=> '\r',
			"\t"	=> '\t',
			"\u"	=> '\u'
			);
		$string	= str_replace( array_keys( $replace ), array_values( $replace ), $string );
		return $string;
	}
1071099
private function normalize(string $string): string
    {
        return \str_replace($this->normalizeFrom, $this->normalizeTo, $string);
    }
97619
protected function encodeDate($string = '')
    {
        // maybe has to be rewritten for multibyte...
        $length        = strlen($string);
        $encodedString = '';

        for ($i = 0; $i < $length; ++$i) {
            $encodedString .= '\\'.$string[$i];
        }

        // return encoded string
        return $encodedString;
    }
784258
public static function printColor ($string, $color = 'white')
		{
			$code = 'w';
			switch ($color)
			{
				case 'black':
					$code = 'k';
					break;
				case 'cyan':
					$code = 'c';
					break;
				case 'gray':
				case 'grey':
					$code = 'K';
					break;
				case 'green':
					$code = 'g';
					break;
				case 'magenta':
					$code = 'm';
					break;
				case 'red':
					$code = 'r';
					break;
				case 'yellow':
					$code = 'y';
					break;
			}
			self::stdout(self::renderColoredString("%" . $code . $string . "%n\n"));
		}
310105
public function clean($string)
    {
        $reg = '#'.preg_quote($this->browser->getHost()).'/ch\d+ \[([^\]]+)\]#';
        $string = preg_replace($reg, '$1', $string);
        $string = preg_replace('/\[[^\[\]]+\]/', '', $string); // remove BB tags

        return $string;
    }
1180613
private function formatStringAsTextBlock($string)
    {
        if (!is_string($string)) {
            return '';
        }

        $string = wordwrap($string, $this->maxLineLength - $this->prefixLength);

        $stringLines = explode(PHP_EOL, $string);
        foreach ($stringLines as &$line) {
            $line = str_repeat(' ', $this->prefixLength).$line;
        }

        $string = implode(PHP_EOL, $stringLines);

        // needed to remove the unnecessary prefix added to the first line
        $string = trim($string);

        return $string;
    }
687368
public static function html($string) {

        if(null === $string) {
            return '';
        }

		if(true === is_numeric($string)) {
    		return $string;
    	}

		if(false === is_string($string)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($string)), E_USER_ERROR);
		}

        return htmlspecialchars($string, static :: $flags, static :: getEncoding());
    }
1196539
public function loadString($string)
    {
        $this->string = htmlspecialchars_decode($string);

        if ($this->config[ 'allowPhpScripts' ] === false) {
            $this->string = preg_replace(
                '/<\\?.*(\\?>|$)/Us',
                '',
                str_replace('<?=', '<?php echo ', $this->string)
            );
        }

        return (bool)empty($this->string);
    }
535237
public static function strToLower($string)
    {
        $string = str_replace(self::$upperTR, self::$lowerTR, $string);

        return mb_strtolower($string, 'UTF-8');
    }
946144
private static function __border($string)
    {
        $border          = new Border(Border::TYPE_FRAME);
        $borderedElement = new BorderedElement($string, $border);

        return $borderedElement->render();
    }
912008
protected function escape($string)
    {
        $string = HTMLPurifier_Encoder::cleanUTF8($string);
        $string = htmlspecialchars($string, ENT_COMPAT, 'UTF-8');
        return $string;
    }
531778
public function formatPlain($string) {
        $groups = $this->formatParser->parseFormat($string);

        foreach ($groups as $group) {
            $tag = $group[0];
            $styleName = $group[1];

            if ($styleName === 'style' || $this->hasStyle($styleName)) {
                $string = str_replace($tag, '', $string);
            }
        }

        $string = $this->formatParser->unescapeTags($string);

        return $string;
    }
350071
def render_string string, options
      escaped = html_escape(string)
      if options[:pretty]
        indent = ' ' * (options[:indent] * options[:depth])
        indent + escaped + "\n"
      else
        escaped
      end
    end