One- and two-bar repeat symbols

Is it possible to remove the rest that still is in the bar…?