Go language StrConv. Examples of parseint

Source: Internet
Author: User

Golang StrConv. parseint is a function that converts a string into a number, which is often powerful, and looks at my saliva.

Func parseint (s string, base int, bitsize int) (I int64, err error)

The string form of the parameter 1 number

Parameter 2 the binary octal decimal hexadecimal of a numeric string, such as binary

Parameter 3 returns the bit size of the result, which is int8 int16 int32 int64

Code:

Package main    Import (    "StrConv")    func Main () {    I, err: = StrConv. parseint("123", ten, +)    if err! = Nil {        panic (err)    }    println (i)}



Go language StrConv. Examples of parseint

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.