企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# STRCONV MODULES ### Author 品茶 > strconv实现基础数据类型与字符串之间的转换。string conv ## 主要方法如下 ~~~ Constants Variables 追加bool类型到[]byte后面,就是很简单的追加 func AppendBool(dst []byte, b bool) []byte func AppendFloat(dst []byte, f float64, fmt byte, prec, bitSize int) []byte func AppendInt(dst []byte, i int64, base int) []byte func AppendQuote(dst []byte, s string) []byte func AppendQuoteRune(dst []byte, r rune) []byte func AppendQuoteRuneToASCII(dst []byte, r rune) []byte func AppendQuoteRuneToGraphic(dst []byte, r rune) []byte func AppendQuoteToASCII(dst []byte, s string) []byte func AppendQuoteToGraphic(dst []byte, s string) []byte func AppendUint(dst []byte, i uint64, base int) []byte string to int 字符串转整型,因为存在不可转,所以会有error func Atoi(s string) (int, error) func CanBackquote(s string) bool 把bool类型转换成字符串 func FormatBool(b bool) string func FormatFloat(f float64, fmt byte, prec, bitSize int) string 进制转换成字符串 func FormatInt(i int64, base int) string func FormatUint(i uint64, base int) string func IsGraphic(r rune) bool 是否可以打印rune,用来判断utf8 func IsPrint(r rune) bool 数字转字符串,所以没有错误接收 func Itoa(i int) string 转换成bool float int uint func ParseBool(str string) (bool, error) func ParseFloat(s string, bitSize int) (float64, error) func ParseInt(s string, base int, bitSize int) (i int64, err error) func ParseUint(s string, base int, bitSize int) (uint64, error) 对字符串中特殊符号进行转义 例于tab ->\t func Quote(s string) string func QuoteRune(r rune) string rune转成asscii的字符串 func QuoteRuneToASCII(r rune) string func QuoteRuneToGraphic(r rune) string func QuoteToASCII(s string) string func QuoteToGraphic(s string) string func Unquote(s string) (string, error) func UnquoteChar(s string, quote byte) (value rune, multibyte bool, tail string, err error) type NumError func (e *NumError) Error() string ~~~