ANSI 转义字符

ANSI C语言中的全部转义字符序列如下:##

a:响铃符

b:回退符

f:换页符

n:换行符

r:回车符

t:横向制表符

v:纵向制表符

:反斜杠

?:问号

':单引号

":双引号

ooo:八进制数

xhh:十六进制数

在编程中经常看到如:\033的转义字符,’\033’ == ‘\x1b’

‘\0’:8进制, ‘\x’:16进制
可以在命令行观察(python)
print(’’\x1b[?25l’)
print(’\x1b[?25h’)

它们的具体意思如下:

转义字符说明
\033[0m关闭所有属性
\033[1m设置高亮度
\033[4m下划线
\033[5m闪烁
\033[7m反显
\033[8m消隐
\033[30m-\33[37m设置前景颜色
\033[40m-\33[47m设置背景颜色
\033[nA光标上移n行
\033[nB光标下移n行
\033[nC光标右移n行
\033[nD光标左移n行
\033[y;xH设置光标位置
\033[2J清屏
\033[K清除从光标到行尾的内容
\034[s保存光标位置
\033[u恢复光标位置
\033[?25l隐藏光标
\033[?25h显示光标

ASCII Table and Description

ASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation of a character such as ‘a’ or ‘@’ or an action of some sort. ASCII was developed a long time ago and now the non-printing characters are rarely used for their original purpose. Below is the ASCII character table and this includes descriptions of the first 32 non-printing characters. ASCII was actually designed for use with teletypes and so the descriptions are somewhat obscure. If someone says they want your CV however in ASCII format, all this means is they want ‘plain’ text with no formatting such as tabs, bold or underscoring - the raw format that any computer can understand. This is usually so they can easily import the file into their own applications without issues. Notepad.exe creates ASCII text, or in MS Word you can save a file as ‘text only’
在这里插入图片描述

Extended ASCII Codes

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值