bash, 6150 bytes
while b=${a%%?^H*}${a#*?^H};[[ "$b""$a" != "$a$a""${a/?^H/}" ];do a=${ba/?^H/};done
Sample:
a=$'Horse^H^H^H^H^HCow'
while b=${a%%?^H*}${a#*?^H};[[ "$b""$a" != "$a$a""${a/?^H/}" ];do a=${ba/?^H/};done
echo $a
Cow
a="Be nice to this fool^H^H^H^Hgentleman, he's visiting from corporate HQ."
while b=${a%%?^H*}${a#*?^H};[[ "$b""$a" != "$a$a""${a/?^H/}" ];do a=${ba/?^H/};done
echo $a
Be nice to this gentleman, he's visiting from corporate HQ.
This could work with real (binaries) backspaces as well:
a=$'Be nice to this fool\b\b\b\bgentleman, he'\'$'s visiting from corporate HQ.'
echo $a.. but:
Be nice to this gentleman, he's visiting from corporate HQ... but:
printf %q\\n "$a"
$'Be nice to this fool\b\b\b\bgentleman, he\'s visiting from corporate HQ.'
while b=${a%%?$'\b'*}${a#*?$'\b'};[[ "$b""$a" != "$a$a""${a/?$'\b'/}" ];do a=${ba/?$'\b'/};done
printf %q\\n "$a"
Be\ nice\ to\ this\ gentleman\,\ he\'s\ visiting\ from\ corporate\ HQ.