Xoring字母与空格字符 [英] Xoring alphabet letters with space character

查看:49
本文介绍了Xoring字母与空格字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有历史原因可以解释为什么用空格字符对任何字母进行异或运算会改变字母的大小写?(即'a'xor''='A','F'xor''='f',等等...)

Is there a historical reason as to why Xoring any alphabetic letter with the space character changes the case of the letter? (i.e., 'a' xor ' ' = 'A', 'F' xor ' ' = 'f', etc...)

或者这仅仅是一个巧合吗?

Or is this just a coincidence?

(假设字符是ASCII或unicode编码的.)

(Assuming the characters are ASCII- or unicode-encoded.)

推荐答案

我确信可以通过更改一点来更改大小写,这将使早期的软件更加有效.空格字符为#32的事实是无关紧要的.

I'm sure it was deliberate that the case could be changed by changing a single bit - it will have made early software much more efficient. The fact that the space character is #32 is irrelevant.

这篇关于Xoring字母与空格字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆