import re


def clean(val):
    """Merge multiple spaces to single space. Remove trailing/leading spaces.

    :Args:
    val: string value to clean

    :Returns:
    cleaned value
    """

    val = re.sub(r'/s+', r'/s', val)
    return val.strip()