aydin-hassan/strip-indent

A tiny library for stripping indents from multi-line scripts, inspired by: (sindresorhus/strip-indent)[https://github.com/sindresorhus/strip-indent]

1.0.0 2014-10-13 21:31 UTC

This package is auto-updated.

Last update: 2024-10-12 20:28:19 UTC


README

Build Status Coverage Status Scrutinizer Code Quality Latest Stable Version

A tiny library for stripping indents from multi-line scripts, inspired by: sindresorhus/strip-indent

The indent amount is counted for the second row, (not the row containing the string declaration). This indent count is removed from each line.

Installation

Composer

composer require aydin-hassan/strip-indent

Usage

<?php
use function AydinHassan\stripIndent;

$multiLineString = '
    <VirtualHost>
        <one>
            <two>
            </two>
        </one>
    </VirtualHost>
    ';

echo stripIndent($line);

/**
<VirtualHost>
    <one>
        <two>
        </two>
    </one>
</VirtualHost>
**/