(data)
return spaces
Get the leading space of a string if it is not empty

    :type data: str
Get the leading space of a string if it is not empty
Get the leading space of a string if it is not empty
def get_leading_spaces(data):
    """Get the leading space of a string if it is not empty

    :type data: str

    """
    spaces = ''
    m = re.match(r'^(\s*)', data)
    if m:
        spaces = m.group(1)
    return spaces
def get_leading_spaces ( data ) : spaces = '' m = re . match ( r'^(\s*)' , data ) if m : spaces = m . group ( 1 ) return spaces