def last_character_split(a_name, char):

    """ In order to split the name and version of a package in a
    standardly named source code directory, one must split the two at a
    standard spot. Some packagers use a '-', like in the file name
    'openbox-3.6.1'. This function splits a name by whatever character it
    is given as its second argument.

    This function returns a tuple of the title and version. If it does not
    detect a version number, then the whole name is likely a title, and the
    version is returned as an empty string.
    """

    dash_index = a_name.rfind(char)

    if a_name[dash_index + 1].isdigit():
        title, version = a_name.rsplit(char, 1)
    else:
        title = a_name.replace(char, '-')
        version = "N/A"

    return title, version