def align(self, string, length=70, pad=30):
        """
        This function split a string into a list of 100 char max strings
        :param string: string to split
        :param length: maximum length of a string, default=70
        :param pad: blank space in front of the string, default=30
        :return: string with \n separator
        """
        s = ''
        strings = []

        # check if "\n" are present in the string. If so, decompose the string.
        string_split_line = string.split('\n')
        if len(string_split_line) > 1:
            for i in range(0,len(string_split_line)):
                if i != 0:
                    string_split_line[i] = '  ' + string_split_line[i]

        # check if a string length is over "length"
        for k,stri in enumerate(string_split_line):
            i = 0
            for c in stri:
                i += 1
                if c == ' ':
                    last_space = i
                if i%length == 0:
                    strings.append(stri[0:last_space])
                    stri = stri[last_space:]
                    if k != 0:
                        stri = '    '+stri
                    i = i - last_space
            strings.append(stri)

        # Concatenate strings
        for i,yes in enumerate(strings):
            if i != 0:
                s += ' '*pad
            s += yes
            if i != len(strings)-1:
                s += '\n'
        return s

########################################################################################################################
# GENERATION OF SOURCEFORGE GENERATED DOC
########################################################################################################################
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/scripts/msct_parser.py/Usage.align/original