DEV Community

loading...

Discussion on: Daily Challenge #1 - String Peeler

Collapse
figueroadavid profile image
David Figueroa

Powershell

function Remove-FirstAndLastCharacter {
    param(
        [parameter(Mandatory,ValueFromPipelineByName)]
        [string]$Input
    )
    if ($Input.length -ge 3)
    { 
        return $Input.SubString(1,$Input.Length - 2)
    }
}