Вопрос

What is the purpose of the Unicode Character 'BACKSPACE' (U+0008) in programming? What applications can it be used for?

Это было полезно?

Решение

Um, it's a backspace character.

On output to a terminal, it typically moves the cursor one position to the left (depending on settings). On input, it typically erases the last entered character (depending on the application and terminal settings), though the DEL / DELETE character is also used for this purpose. Typically it can be entered by pressing Backspace or Control-H

Note that its action of deleting characters occurs only on a display, not in memory. A string within a running program can contain just about any sequence of characters (depending perhaps on the language), including backspace. In that context, it's generally just another character. For example, in C strlen("abcd\b") is 5, not 3.

In C and a number of other languages, it's represented in program source as '\b'. It's sometimes displayed as ^H.

All this applies whether it's represented as Unicode or not. The backspace character is common to most or all character sets: ASCII, Latin-1, the various Unicode representations -- even EBCDIC has a backspace character (but with a different code).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top