Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the backspace character do?

I was reading over some of the MDN pages on regex, and came across a reference to the backspace unicode character, which intrigued me, because I wouldn't have though that backspace would have a character.

The code for it is \U+0008. I decided to run a test and see what it was/did, so I entered 'abcd\u0008efg', in a browser, which returned "abcdefg". I got the same for console.log.

My question is, what is a backspace character, and does it do anything when rendered in html/javascript?

like image 260
ckersch Avatar asked Nov 01 '22 18:11

ckersch


1 Answers

I think the backspace character is in Unicode for compatibility with ASCII. ASCII has several control characters that do not make much sense to have in a text file, but were transmitted to and from terminals. For example bell, escape, acknowledge, end of transport block.

like image 110
Tor Klingberg Avatar answered Nov 12 '22 19:11

Tor Klingberg