字符串操作
len(str) // 内置函数r := []rune(str)n, err = strconv.Atoi("66")str = strconv.Itoa(6887)strings.Contains("Hello World", "llo")strings.Count("Hello World", "o")strings.HasPrefix("http://yangsx95.com", "http") strings.HasSuffix("http://yangsx95.com", ".com")strings.EqualFold("go", "GO")strings.IIndex("Hello World", "o")strings.Replace("Hello World", "o", "hah", n)strings.Split("Hello World", "o")strings.ToLower("Go") // go strings.ToUpper("Go") // GOstrings.Trim("~go~", "~") // gostrings.TrimSpace(" go ") // gostrings.TrimLeft("~go~", "~") // go~strings.TrimRight("~go~", "~") // ~go
最后更新于