Use code to query ASCII code and Unicode code table serial number

Foreword:

For all current characters in computer languages, there is a corresponding binary, and it is unique. The more common ones are the ASCII code table, and the full name of the ASCII code table is American Code for Information Interchange, the American Standard Code for Information Interchange. . There is also a universal code table Unicode code table, the Chinese name is called the universal code, which is a character comparison table.

text:

For how to query the serial number of a character in the code table in the code, look at the code below (java version)

public class Demo03DataTypeChar{
	public static void main(String[] args){
		char zifu1 = '中';
		int a = zifu1+0;
		System.out.println(zifu1 + 0);
		System.out.println(a);
	}
}  

In this line of code, the first line is the class name, the second line is the main program window, the third line is assigned a char type character, the fourth is an int type character, and the fifth and sixth lines are output. Look at the input results:

The first output result is the character itself, the second output result is the code table serial number, and the third output result is also the code table serial number, but after a conversion, it can be stored in the code and then output.

If there is a need to use the code table serial number, you can use variables to solve this problem, and it is convenient to change the character at any time.

Guess you like

Origin blog.csdn.net/weixin_37081112/article/details/112388456