Modify a URI part

@param string $str the URI part string representation

@return string the modified URI part string representation
501892
protected function modifyPath(string $str): string
    {
        return (string) $this->filterSegment($str)->withBasename($this->basename);
    }
16520
protected function strtoupper($str)
    {
        $str = html_entity_decode($str, $this->htmlFuncFlags, self::ENCODING);
        $str = mb_strtoupper($str);
        $str = htmlspecialchars($str, $this->htmlFuncFlags, self::ENCODING);

        return $str;
    }
1149695
protected function modifyPath(string $str): string
    {
        if ('' != $str && '/' !== $str[0]) {
            $str = '/'.$str;
        }

        if (0 === strpos($str, (string) $this->basepath)) {
            return $str;
        }

        return (string) $this->basepath->append($str);
    }
136391
protected function hashString($str)
    {
        if (is_callable($this->hashMethod)) {
            return call_user_func($this->hashMethod, $str);
        } else {
            return hash($this->hashMethod, $str);
        }
    }
1275421
public static function webappPrefixTooShort(string $str)
    {
        $length = strlen($str);
        if ($length === 0) {
            return new self(sprintf(
                'The WebApp Prefix must be at least 3 characters. You supplied an empty Prefix.'
            ));
        } else {
            return new self(sprintf(
                'The WebApp Prefix must be at least 3 characters. You supplied a %s character Prefix: %s',
                $length,
                $str
            ));
        }
    }
82468
public function widont($str) {
		$str = rtrim($str);
		$space = strrpos($str, ' ');

		if ($space !== false) {
			$str = substr($str, 0, $space) . '&nbsp;' . substr($str, $space + 1);
		}

		return $str;
	}
437130
public function replaceText(string $str) : string
    {
    	foreach (Unicode::$char as $key => $value) {
    		if ($key === $str) {
    			$result = ((count($value) > 1) ? Unicode::$char[$key][random_int(0, count($value)-1)] : Unicode::$char[$key][0]);
    		}
    	}
    	
    	return $result ?? $str;
    }
760670
public static function toLower($str)
    {
        return self::$use_mbstring
            ? mb_strtolower($str, self::$char_set)
            : strtolower($str);
    }
283127
private function fixUriParts($url)
    {
        $position = Str::strpos($url, '?') ?: Str::strpos($url, '#');

        if ($position === false) {
            return $url;
        }

        return Str::substr($url, 0, $position) . '/' . Str::substr($url, $position);
    }
828486
protected function modifyHost(string $str): string
    {
        return (string) $this->filterHost($str)->getContent(EncodingInterface::RFC3987_ENCODING);
    }
617019
protected function _addFileHash($str)
    {
        return preg_replace_callback('#="(/[^"\':{$?]+[^/])"#', function ($match) {
            $url = $match[1];
            $path = '@public' . $url;
            if (strpos($path, '.') === false || strpos(basename($path), '.') === false || pathinfo($path, PATHINFO_EXTENSION) === 'html') {
                return $match[0];
            }
            $file = $this->alias->resolve($path);
            if (!is_file($file)) {
                throw new InvalidUrlException(['`:file` file is not exists', 'file' => $path]);
            }
            $hash = substr(md5_file($file), 0, $this->_hash_length);

            return "=\"$url?v=$hash\"";
        }, $str);
    }
1195635
public static function trimSpaceInStr($str)
    {
        $pat = array(" ", "　", "\t", "\n", "\r");
        $string = array("", "", "", "", "", );
        return str_replace($pat, $string, $str);
    }
1019111
protected static function str2bits($str) 
    {
        $bits  = '';
        $total = strlen($str);

        $i = -1;
        while (++$i < $total) {
            $char = $str[$i];
            $pos  = strpos(self::$_encode, $char);

            if ($pos !== false) {
                $bits .= substr(self::$_binary, $pos*5, 4);
            } else {
                $int   = ord($char);
                $bits .= '1'.substr(self::$_bin, (int)($int/16)*5, 4);
                $bits .= substr(self::$_bin, ($int%16)*5, 4);
            }
        }

        // Complete nibbel
        $add   = strlen($bits) % 4;
        $bits .= str_repeat('0', $add);

        return $bits;
    }
1346048
public static function slug($str)
    {
        $str = strtr($str, self::$url_replace);
        $str = strtolower(utf8_decode($str));
        $str = Utils::trim(preg_replace(['/[^a-z0-9\s]/', '/[\s]+/'], ['', '-'], $str), '-');

        if (empty($str)) {
            $str = 'view';
        }

        return $str;
    }
171126
public static function encode(String $str) : String
    {
        $chars = self::$numericalCodes;

        return str_replace(array_keys($chars), array_values($chars), $str);
    }
321674
function _set_uri_string($str)
	{
		// Filter out control characters
		$str = remove_invisible_characters($str, FALSE);

		// If the URI contains only a slash we'll kill it
		$this->uri_string = ($str == '/') ? '' : $str;
	}
668183
private function append_str($str)
  { 
    $this->check_closed(); 
    $this->string_buffer .= $str; 
    $len = strlen($str); 
    $this->current_index += $len; 
    return $len; 
  }