golang
  • Introduction
  • 环境安装
    • vscode
    • liteide
  • 第一个Go程序
  • Go项目结构
  • Go语言命令
  • 变量
  • 数据类型
    • array
    • slice
    • map
    • struct
    • interface
    • string
    • channel
    • 类型转换
  • 循环语句
  • HTTP编程
  • init函数
Powered by GitBook
On this page
  • 简介
  • 声明语义
  • 初始化方法
  • 赋值操作
  • 拼接
  • Atoi

Was this helpful?

  1. 数据类型

string

简介

声明语义

初始化方法

赋值操作

拼接

Atoi

可以利用strconv包中的Atoi函数将一个string转换为整型,如下:

import strconv

func myFunc() {
    number, err = strconv.Atoi("123")
}
PreviousinterfaceNextchannel

Last updated 5 years ago

Was this helpful?