package main
import (
"fmt"
)
func main(){
//字符串
var s1 string = "hello"
s2 := []rune(s1)
s2[0] = 'c'
s3 := string(s2)
fmt.Printf("%s\n",s3)
//字符串换行语法
s := "Starting part" +
"Ending part"
fmt.Printf("S'Value is: %s\n",s)
//复数:它的变量类型是complex128 (64 位虚数部分)。如果需要小一些的,还有complex64 – 32 位的虚数部分。
var c complex64 = 5+5i;fmt.Printf("Value is: %v",c)
}
go字符串复数
最新推荐文章于 2024-04-09 19:19:45 发布