• Returns the last past segment for a '' delimited string

    Parameters

    • path: string

      to a folder or a file

    Returns string

    the last segment

    getLastPathSegment('\\hello\\world\\'); // 'world'
    getLastPathSegment('\\hello\\'); // 'hello'
    getLastPathSegment('\\hello\\\\'); // ''