Automattic\WooCommerce\Vendor\Sabberworm\CSS

OutputFormatter::removeLastSemicolonpublicWC 1.0

Method of the class: OutputFormatter{}

No Hooks.

Returns

String.

Usage

$OutputFormatter = new OutputFormatter();
$OutputFormatter->removeLastSemicolon( $sString );
$sString(string) (required)
.

OutputFormatter::removeLastSemicolon() code WC 10.8.1

public function removeLastSemicolon($sString)
{
    if ($this->oFormat->get('SemicolonAfterLastRule')) {
        return $sString;
    }
    $sString = explode(';', $sString);
    if (count($sString) < 2) {
        return $sString[0];
    }
    $sLast = array_pop($sString);
    $sNextToLast = array_pop($sString);
    array_push($sString, $sNextToLast . $sLast);
    return implode(';', $sString);
}