daemon: Add a trim utility function.