go 转义字符 running

package main

import (
	"fmt"
)

func main() {
	fmt.Println("姓名\t年龄\t籍贯\t地址\njohn\t20\t河北\t北京") //\t  一个制表位,实现对齐的功能
	fmt.Println("\\") 
	fmt.Println("\"")
	fmt.Println("a\nb")  // \n 换行符
	fmt.Println("tom\rjac") //\r 回车,从当前行的最前面开始输出,覆盖掉以前内容
	fmt.Println("tom\tand\t\"jackk\"")


}

  

输出结果:

原文地址:https://www.cnblogs.com/zxqblogrecord/p/15821843.html