stream's clear() and str().
demo list.erase().