Removes a string from the end of another given string if it already ends with it.

@param  string  $name
@param  string  $fix

@return string
350926
public static function removePostFixWith($name, $fix = '/')
    {
        $position = strripos($name, $fix);

        if ($position !== false) {
            return substr($name, 0, $position);
        }

        return $name;
    }
329917
protected function string(string $name): Closure
    {
        return function (Table $table, MigrationContextInterface $context) use ($name) {
            $length = $context->getModelSchemas()->getAttributeLength($context->getModelClass(), $name);
            $table->addColumn($name, Type::STRING)->setLength($length)->setNotnull(true);
        };
    }
922592
public static function removeOperations($name)
    {
        $names = func_get_args();
        self::$operations = filter(function($operation) use($names) {
            return !in_array(get('name', $operation), $names);
        }, self::$operations);
    }
990614
public function replaceBy($name)
    {
        $content = $this->get($name);
        if ($content === self::NO_SECTION_RENDER) {
            ob_end_clean();

            return; // do not render anything.
        } elseif ($content) {
            ob_end_clean();
            echo $content;
        } else {
            echo ob_get_clean();
        }
    }
1296913
protected function parseExtend($name)
    {
        $this->setExtendedClass(null);

        $nameParts = explode('@extend', $name);
        $name = trim($nameParts[0]);
        if (count($nameParts) > 1) {
            $this->setExtendedClass($nameParts[1]);
        }

        return $name;
    }
683231
protected function sensible($name)
    {
        $name = preg_replace('`([A-Z])`', '-\1', $name);
        $name = str_replace(array('-', '_'), ' ', $name);

        return ucfirst(trim(strtolower($name)));
    }
874927
public function remove($name)
    {
        parent::remove($name);

        return $this->set($name, null, [
            self::OPTION_EXPIRE => 0
        ]);
    }
400461
public static function removePrefix($string, $prefix)
    {
        if (self::startsWith($string, $prefix)) {
            return substr($string, mb_strlen($prefix));
        }
        return $string;
    }
729265
protected function removePartial($name): bool
    {
        $status = true;
        foreach (scandir($this->path) as $file) {
            if (pathinfo($this->path . $file, PATHINFO_EXTENSION) !== "cache") {
                continue;
            }
            if (strpos($file, $name) !== false) {
                $status = unlink($this->path . $file) && $status;
            }
        }
        return $status;
    }
57806
public function delete($name)
    {
        $nameString = TypeHinter::to('USVString', $name);
        array_splice($this->list, 0, count($this->list), array_filter($this->list, function ($pair) use ($nameString) {
            return $pair[0] !== $nameString;
        }));
        $this->update();
    }
518573
public function remove($name)
    {
        $this->requireNames();
        
        $lower = strtolower($name);
        if(array_key_exists($lower, $this->names)) {
            $name = $this->names[$lower];
            unset($this->names[$lower]);
            unset($this->headers[$name]);
        }
    }
852985
public function end($name = self::DEFAULT_NAME)
    {
        $this->end_time[$name] = microtime(true);
        $this->memory_usage[$name] = memory_get_usage(true);
    }
1183055
public function delete($name)
  {
    $path = $this->_getPath($name);
    
    if (file_exists($path)) {
      $result = @unlink($path);
    } else {
      $result = false;
    }
    
    return $result;
  }
651730
private static function removeContainerFromName($container, $name)
    {
        $name = static::asLocalPath($name);

        if (empty($container)) {
            return $name;
        }
        $container = FileUtilities::fixFolderPath($container);

        return substr($name, strlen($container) + 1);
    }
1112942
private static function lowerConstantName(string $name): string
    {
        $parts = explode('\\', $name);

        $lastPart = array_pop($parts);

        $parts = array_map('strtolower', $parts);

        $parts[] = $lastPart;

        return implode('\\', $parts);
    }
44960
public function remove($name)
    {
        $removed = false;
        if ($this->has($name)) {
            unset($this->_inputs[$name]);
            $removed = true;
        }
        return $removed;
    }
764410
public function remove($name)
    {
        if(!is_array($name))
        {
            $name = func_get_args();
        }
        foreach($name as $val)
        {
            $type = gettype($val);
            if('string' === $type)
            {
                $val = explode('.', $val);
            }
            else if('array' !== $type)
            {
                return false;
            }
            $last = array_pop($val);
            $result = &$this->data;
            foreach ($val as $value)
            {
                if (isset($result[$value]))
                {
                    $result = &$result[$value];
                }
            }
            unset($result[$last]);
        }
        return true;
    }