From String

@since 2.1.0
@access public
@param string $string
@return \Icepay_Webservice_Filtering
487548
public function importFromString($string)
    {
        $this->_paymentMethodsArray = unserialize(urldecode($string));
        $this->_paymentMethodsArrayFiltered = $this->_paymentMethodsArray;
        return $this;
    }
655025
public static function fromString( $string )
	{
#		$string		= trim( $string );
		$parts		= explode( "\r\n\r\n", $string );
		$response	= new Net_HTTP_Response;
		while( $part = array_shift( $parts ) )
		{
			$pattern	= '/^([A-Z]+)\/([0-9.]+) ([0-9]{3}) ?(.+)?/';
			if( !preg_match( $pattern, $part ) )
			{
				array_unshift( $parts, $part );
				break;
			}
			if( !$response->headers->getFields() )
				$response	= self::parseHeadersFromString( $part );
		};
		$body	= implode( "\r\n\r\n", $parts );

/*		$encodings	= $response->headers->getField( 'content-encoding' );
		while( $encoding = array_pop( $encodings ) )
		{
			$method	= $encoding->getValue();
			$body	= Net_HTTP_Response_Decompressor::decompressString( $body, $method );
		}*/
		$response->setBody( $body );
		return $response;
	}
817028
private function parseStringToArray($string)
    {
        // convert commas to spaces
        $string = str_replace(',', ' ', $string);
        // convert new lines to spaces
        $string = str_replace(PHP_EOL, ' ', $string);
        // split on the spaces and filter out empty elements
        return array_values(
            array_filter(
                array_map(
                    'trim',
                    explode(' ', $string)
                ),
                'strlen'
            )
        );
    }
1240915
public static function fromString( $string )
	{
		// Make sure the string does not contain non-hex characters
		$matched = preg_match( "/[^0-9a-fA-F]+/", $string, $matches );
		if ( $matched || strlen( $string ) % 2 != 0 )
		{
			throw XPath2Exception::withErrorCodeAndParams( "FORG0001", Resources::InvalidFormat, array( $string, "xs:hexBinary" ) );
		}

		$binary = hex2bin( $string );
		return new HexBinaryValue( $binary );
	}
448054
private function encrypt($string = "")
    {

        $key = $this->config->get('gateway.asanpardakht.key');
        $iv = $this->config->get('gateway.asanpardakht.iv');

        try {

            $soap = new SoapClient("https://services.asanpardakht.net/paygate/internalutils.asmx?WSDL");
            $params = array(
                'aesKey' => $key,
                'aesVector' => $iv,
                'toBeEncrypted' => $string
            );

            $response = $soap->EncryptInAES($params);
            return $response->EncryptInAESResult;

        } catch (\SoapFault $e) {
            return "";
        }
    }
461225
public function fromString($string)
    {
        $fs = new Filesystem();
        $dir = sys_get_temp_dir().DIRECTORY_SEPARATOR.'gush';

        if (!file_exists($dir)) {
            $fs->mkdir($dir);
        }

        $tmpName = tempnam($dir, '');
        file_put_contents($tmpName, $string);
        $editor = getenv('EDITOR');

        if (!$editor) {
            throw new \RuntimeException('No EDITOR environment variable set.');
        }

        if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
            $processHelper = $this->getHelperSet()->get('process');
            /** @var ProcessHelper $processHelper */
            $process = $processHelper->getProcessBuilder($editor.' '.escapeshellarg($tmpName))->getProcess();
            $process->setTimeout(null);
            $process->start();

            // Wait till editor closes
            $process->wait();
        } else {
            system($editor.' '.$tmpName.' > `tty`');
        }

        $contents = file_get_contents($tmpName);
        $fs->remove($tmpName);

        return $contents;
    }
618379
static function fromString(string $string): self
    {
        $string = str_replace("/", "\\", $string);
        $string = preg_replace("#(\\\\){2,}#", "\\", $string);
        if (substr($string, -1, 1) == "\\") {
            $string = substr($string, 0, -1);
        }
        
        return new self($string);
    }
162895
public function parseString($string)
    {
        //argument 1 must be a string
        Argument::i()->test(1, 'string');
        
        foreach ($this->data as $key => $value) {
            $string = str_replace($key, $value, $string);
        }

        return $string;
    }
763530
private function decrypt($string = "")
    {
        $key = $this->config->get('gateway.asanpardakht.key');
        $iv = $this->config->get('gateway.asanpardakht.iv');

        try {

            $soap = new SoapClient("https://services.asanpardakht.net/paygate/internalutils.asmx?WSDL");
            $params = array(
                'aesKey' => $key,
                'aesVector' => $iv,
                'toBeDecrypted' => $string
            );

            $response = $soap->DecryptInAES($params);
            return $response->DecryptInAESResult;

        } catch (\SoapFault $e) {
            return "";
        }
    }
927949
public static function ucFirst($string)
    {
        $ucFirst = static::sub($string, 0, 1);
        $ucFirst = static::upp($ucFirst);

        return $ucFirst . static::sub($string, 1);
    }
766999
private static function fromHStore($string)
    {
        $result = [];
        if (empty($string)) {
            return $result;
        }

        preg_match_all(
            '#"((?:\\\"|[^"])*)"=>"((?:\\\"|[^"])*)"#U',
            $string,
            $matches
        );
        foreach ($matches[1] as $id => $val) {
            $result[stripcslashes($val)] = stripcslashes($matches[2][$id]);
        }

        return $result;
    }
402539
public static function fromString(string $string): self
    {
        if (1 !== \preg_match('/^( *|\t+)$/', $string)) {
            throw Exception\InvalidIndentStringException::fromString($string);
        }

        return new self($string);
    }
702813
public static function clearString( string $string ) {
		$string = trim( $string );
		$string = stripslashes( $string );
		$string = htmlspecialchars( $string );

		return $string;
	}
336504
public function txt($string)
	{
		$args  = func_get_args();
		$count = count($args);

		if ($count > 1)
		{
			if ($count == 2 && is_bool($args[1]))
			{
				return $this->translate($string, $args[1]);
			}

			if ($count == 3 && is_bool($args[1]) && is_bool($args[2]))
			{
				return $this->translate($string, $args[1], $args[2]);
			}

			if (is_array($args[$count - 1]))
			{
				$args[0] = $this->translate(
					$string, array_key_exists('jsSafe', $args[$count - 1]) ? $args[$count - 1]['jsSafe'] : false,
					array_key_exists('interpretBackSlashes', $args[$count - 1]) ? $args[$count - 1]['interpretBackSlashes'] : true
				);
			}
			else
			{
				$args[0] = $this->translate($string);
			}
			$args[0] = preg_replace('/\[\[%([0-9]+):[^\]]*\]\]/', '%\1$s', $args[0]);

			return call_user_func_array('sprintf', $args);
		}

		return $this->translate($string);
	}
383045
public static function filterPunctuation(string $string): string
    {
        $string = preg_replace('#[\x{2010}-\x{2015}\x{2053}]#u', '-', $string);
        $string = preg_replace('#[\x60\xB4\x{2B9}\x{2BB}-\x{2BF}\x{2018}-\x{201B}]#u', '\'', $string);
        $string = preg_replace('#[\xAB\xBB\x{2BA}\x{201C}-\x{201F}\x{2039}\x{203A}]#u', '"', $string);
        $string = preg_replace('#[\x{2116}]#u', '#', $string);

        return $string;
    }
1127408
public static function fromString($string)
    {
        return ctype_digit($string)
            ? new static((int) $string)
            : self::fromNative(new \DateTime($string));
    }
417984
public static function fromString($string)
    {
        \Assert\that($string)
            ->string('Argument has to be a string')
            ->uuid('String has to be an UUID');

        return new static(Uuid::fromString($string));
    }