1 需求
2 接口
3 示例代码
示例代码:回车、换行的ASCII值
public class Test {
public static void main(String[] args) {
// char转int、char转String
System.out.println("\r的ascii值:" + Integer.valueOf('r'));
System.out.println("\n的ascii值:" + Integer.valueOf('n'));
System.out.println("CR = '\r' = 0x0D");
System.out.println("LF = '\n' = 0x0A");
}
}
4 参考资料
ASCII中LF与CR区别?_mswsf的博客-CSDN博客_ascii cr
如何用java获得字符串的ASCII值 - Hi_Amos - 博客园



