stream replace to string