def characters(String,returnString=False) :
    """
    Validates a string to be compilant with DL structure
    
    Parameters
    ----------
    String : the string to be validated
    returnString : True returns the compilant string, 
                   False returns True or False according to the input string  
    
    
    Returns
    -------
    True if String is compilant
    False if not compilant
    
    if returnString=True then modified String will be returned.
    """
    # remove blank spaces and beggining and end and make UPPERCASE
    NewString = String.upper().strip()
    # replace special characters by '_'
    for s in [',','(',')','=','+','#','.',';',' '] :
        NewString = NewString.replace(s,'_')
    # replace '&' by '_AND_'
    NewString = NewString.replace('&','_AND_')
    
    # eliminate dobble '_'
    while '__' in NewString :
        NewString = NewString.replace('__','_')
    
    # remove '_' and the begging and end of the file name, then concatenate the extension in uppercase
    NewString = NewString.strip('_')
    
    if not returnString :
        return NewString == String
    else : # returnString == True
        return NewString