Execute the TRANSFORM mode.

@param string $str The string to be tokenized
325567
protected function replace(array &$str, $pattern, $replacement)
    {
        foreach ($str as &$s) {
            $s = preg_replace($pattern, $replacement, $s);
        }
    }
415216
public function write(string $str)
    {
        $handler = fopen($this->_path, "w");
        fwrite($handler, $str);
        fclose($handler);
    }
219264
protected function translate($str, $params = array())
    {
        if (isset($this->translator)) {
            return $this->translator->trans($str, $params);
        }
        else {
            $finalParams = array();
            foreach ($params as $placeholder => $value) {
                $finalParams['{'.$placeholder.'}'] = $value;
            }
            return strtr($str, $finalParams);
        }
    }
998013
private function processStringTransformers( $string, Modifier $modifier )
    {

        // there can be multiple transformers are separated by |
        foreach( explode( '|', $string ) as $fragment ) {

            switch( true ) {

                case $fragment === 'null':

                    $modifier->add( 'pre', '\Bond\nullify' );
                    break;

                case substr( $fragment, 0, 4 ) === 'cast':

                    // extract type type from a modifier of the type cast(int), cast(text)
                    // default to the passed type if that doesn't work
                    $castTo = substr( $fragment, 5, -1 ) ?: $modifier->type;
                    // $castTo = $modifier->quoteInterface->quoteIdent( $castTo );

                    $modifier->add( 'post', $modifier->generateCastClosure( $castTo ) );
                    break;

                default:

                    throw new UnknownQueryModifier( $modifier );

            }

        }

    }
1140457
protected function _replaceTranslate($str) {
		// [__]Text to translate[/__]
		if (preg_match_all('/\[__\](.*?)\[\/__\]/i', $str, $matches)) {
			foreach ($matches[0] as $i => $find) {
				$str = str_replace($find, I18n::translate($matches[1][$i]), $str);
			}
		}

		// [__d|domain]Text to translate[/__d]
		if (preg_match_all('/\[__d\|(.+?)\](.*?)\[\/__d\]/i', $str, $matches)) {
			foreach ($matches[0] as $i => $find) {
				$str = str_replace($find, I18n::translate($matches[2][$i], null, $matches[1][$i]), $str);
			}
		}

		// [__c|category]Text to translate[/__c]
		if (preg_match_all('/\[__c\|(.+?)\](.*?)\[\/__c\]/i', $str, $matches)) {
			foreach ($matches[0] as $i => $find) {
				$str = str_replace($find, I18n::translate($matches[2][$i], null, null, $matches[1][$i]), $str);
			}
		}

		return $str;
	}
915957
private function _do($str)
    {
        $str = (string) $str;
        $strInt = (int) $str;
        $strFloat = (float) $str;
        if (
            !$str
            ||
            (string) $strInt === $str
            ||
            (string) $strFloat === $str
        ) {

            // no xss found
            if ($this->_xss_found !== true) {
                $this->_xss_found = false;
            }

            return $str;
        }

        // remove the BOM from UTF-8 / UTF-16 / UTF-32 strings
        $str = UTF8::remove_bom($str);

        // replace the diamond question mark (�) and invalid-UTF8 chars
        $str = UTF8::replace_diamond_question_mark($str, '');

        // replace invisible characters with one single space
        $str = UTF8::remove_invisible_characters($str, true, ' ');

        // normalize the whitespace
        $str = UTF8::normalize_whitespace($str);

        // decode UTF-7 characters
        $str = $this->_repack_utf7($str);

        // decode the string
        $str = $this->_decode_string($str);

        // remove all >= 4-Byte chars if needed
        if ($this->_stripe_4byte_chars) {
            $str = (string) \preg_replace('/[\x{10000}-\x{10FFFF}]/u', '', $str);
        }

        // backup the string (for later comparision)
        $str_backup = $str;

        // remove strings that are never allowed
        $str = $this->_do_never_allowed($str);

        // corrects words before the browser will do it
        $str = $this->_compact_exploded_javascript($str);

        // remove disallowed javascript calls in links, images etc.
        $str = $this->_remove_disallowed_javascript($str);

        // remove evil attributes such as style, onclick and xmlns
        $str = $this->_remove_evil_attributes($str);

        // sanitize naughty JavaScript elements
        $str = $this->_sanitize_naughty_javascript($str);

        // sanitize naughty HTML elements
        $str = $this->_sanitize_naughty_html($str);

        // final clean up
        //
        // -> This adds a bit of extra precaution in case something got through the above filters.
        $str = $this->_do_never_allowed_afterwards($str);

        // check for xss
        if ($this->_xss_found !== true) {
            $this->_xss_found = !($str_backup === $str);
        }

        return $str;
    }
273873
public function out($str, $opt = array())
    {
        $data = array_merge($opt, ['text' => rtrim($str, "\n")]);
        //if($color)$data['style']='color: '.$color;
        $this->sseMessageJSON($data);
    }
269192
public function wrap($str, $wrap)
    {
        return (is_string($str) && $str !== '') ? $wrap.$str.$wrap : $str;
    }
111989
public static function tokenize_string($str, $minlen = 2)
    {
        $expr = array('/[\s;,"\'\/+-]+/ui', '/(\d)[-.\s]+(\d)/u');
        $repl = array(' ', '\\1\\2');

        if ($minlen > 1) {
            $minlen--;
            $expr[] = "/(^|\s+)\w{1,$minlen}(\s+|$)/u";
            $repl[] = ' ';
        }

        return array_filter(explode(" ", preg_replace($expr, $repl, $str)));
    }
877604
public function send(string $str): void
    {
        if ($this->need_headers) {
            $this->sendHttpHeaders();
        }
        $this->need_headers = false;

        fwrite($this->opt->getOutputStream(), $str);
    }
1049943
public function execute()
    {
        if (!empty($this->args[1])) {
            $this->args[0] .= "', '".str_replace('\'', '"', $this->args[1]);
        }

        HTML\Generator::call(
            'script',
            array(
                str_replace(':UA:', $this->args[0], self::JS)
            ),
            array(
                'compress',
                'inlineInner',
                'noCache'
            )
        );
    }
716681
protected function _processString($str, $opts)
    {
        if (!empty($opts['length'])) {
            return substr($str, empty($opts['start']) ? 0 : $opts['start'], $opts['length']);
        } elseif (!empty($opts['start'])) {
            return substr($str, $opts['start']);
        }

        return $str;
    }
263917
public function prompt($str)
    {
        self::write( $str, false );
        $this->user_response = trim( fgets( $this->input, 4096 ) );
    }
1132464
public function seeTextInEmail($str)
    {
        $this->assertTrue($this->contains($str, $this->driver->getStringsByEmail($this->getCurrentMail())));
    }
505989
function SetStyles($str)
	{
		$style = '';
		foreach (['B', 'I'] as $s) {
			if (strpos($str, $s) !== false) {
				$this->$s = true;
				$style .= $s;
			} else {
				$this->$s = false;
			}
		}
		$this->currentfontstyle = $style;
		$this->SetFont('', $style, 0, false);
	}
893432
public function transform(array &$samples) : void
    {
        foreach ($samples as &$sample) {
            foreach ($sample as &$feature) {
                if (is_string($feature)) {
                    if ($this->trim) {
                        $feature = preg_replace(self::SPACES_REGEX, self::SPACE, trim($feature)) ?: '';
                    }

                    $feature = strtolower($feature);
                }
            }
        }
    }
420567
public static void startDoing(String str) {
    System.err.print(str);
    System.err.print(" ... ");
    System.err.flush();
    startTime();
  }