字串
Last updated
Was this helpful?
Last updated
Was this helpful?
``可用來放多行的字串,並且輸出會保留空格
用' '會錯誤
用" "或` `會錯誤
可用== 或是 strings.Compare(a, b)
strings.Compare比 == 效率更好
結果是: 0 假如 a == b,
結果為 -1 假如 a < b
結果為 1 假如 a > b.
strings.Contains()
回傳true或false
也可用strings.ContainsAny("failure", "ura & i")
如果用&在contains() 還是會傳回false
以空格分隔轉為Array
第二個參數例如strings.FieldsFunc("test", func (c rune) bool { return true })