Trim trailing and leading space in ids