1
0
Fork
You've already forked go-strparse
0
Package strparse provides tools for parsing strings and returning basic Go types, for the Go programming language.
  • Go 100%
Find a file
2026年07月05日 09:49:48 -07:00
go.mod unix time 2026年07月05日 09:34:39 -07:00
go.sum unix time 2026年07月05日 09:34:39 -07:00
LICENSE initial commits 2025年09月10日 05:57:07 -07:00
mustparse.go strparse.MustParse() 2025年09月10日 06:07:49 -07:00
parse.go unix time 2026年07月05日 09:34:39 -07:00
parseelse.go strparse.ParseElse() 2025年09月10日 06:02:31 -07:00
parseok.go strparse.ParseOK() 2025年09月10日 06:14:49 -07:00
parseok_test.go added support for float32 and float64 2026年04月12日 22:54:39 -07:00
README.md initial commits 2025年09月10日 05:57:07 -07:00
type.go unix time 2026年07月05日 09:49:48 -07:00

go-strparse

Package strparse provides tools for parsing strings and returning basic Go types, for the Go programming language.

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-strparse

GoDoc

Examples

Here is an example of trying to parse a string and returning a uint16:

tcpport,error:=strparse.Parse[uint16]("1234")

Here is an example of trying to parse a string and returning a uint16, but if the string doesn't represent a uint16 number, then defaulting it to 8080:

tcpport:=strparse.ParseElse[uint16]("1234",8080)

Import

To import package strparse use import code like the following:

import "github.com/reiver/go-strparse"

Installation

To install package strparse do the following:

GOPROXY=direct go get github.com/reiver/go-strparse

Author

Package strparse was written by Charles Iliya Krempeaux