format echo string, trip new line char