Is there a function that trims trailing and leading newlines but NOT spaces?