转义字符
来源:互联网 发布:nginx负载均衡 编辑:程序博客网 时间:2024/05/16 21:56
/*转义字符:特殊字符使用”\”把其转化成字符的本身输出,那么使用”\”的字符称作为转移字符。需求: 在控制台上打印一个 hello" world 常见的转义字符有: \b Backspace (退格键) \t Tab 制表符(制表符的作用就是为了让一列对齐) 一个tab一般等于四个空格。 \n 换行 \r 回车 把光标移动到一行的首位置上。注意: 如果是在windows系统上操作文件的时候需要换行,是需要\r\n一起使用的。如果是在其他的操作系统上需要换行,仅需要\n即可。*/import java.io.*;class Demo16 { public static void main(String[] args) throws Exception { //System.out.println("Hello哈哈\rworld!"); File file = new File("F:\\a.txt"); FileWriter out = new FileWriter(file); out.write("大家好\r\n"); out.write("你们好"); out.close(); }}
0 0
- 转义字符
- 字符转义
- 转义字符
- 转义字符
- 转义字符
- 转义字符
- 转义字符
- 转义字符
- 转义字符
- 转义字符
- 转义字符
- 转义字符
- 转义字符
- 转义字符
- 转义字符
- 字符转义
- 字符转义
- 转义字符
- css跟随页面样式
- 零基础学python-6.2 共享引用
- swift中!与?的用法的个人理解
- 断点续传---多线程下载进阶(二)
- Swift2.0初见笔记
- 转义字符
- bp人工神经网络算法
- windows 8.1系统下硬盘安装ubuntu 14.04 双系统
- MFC为对话框添加背景图片(非picture control控件)
- break & continue
- 辛星浅析PL/pgsql语法(上)
- 第一天 纪念一下
- css页面布局
- Web前端开发规范手册