Documentation ¶
Index ¶
- Variables
- func EqualFoldWithoutChars(s1, s2 string) bool
- func IsLetter(b byte) bool
- func IsLetterLower(b byte) bool
- func IsLetterUpper(b byte) bool
- func IsNumeric(s string) bool
- func NewReadCloser(content []byte, repeatable bool) io.ReadCloser
- func NewReadCloserWithReadCloser(r io.ReadCloser, repeatable bool) (io.ReadCloser, error)
- func RemoveSymbols(s string) string
- func ReplaceByMap(origin string, replaces map[string]string) string
- func SplitAndTrim(str, delimiter string, characterMask ...string) []string
- func StripSlashes(str string) string
- func Trim(str string, characterMask ...string) string
- func UcFirst(s string) string
- type ReadCloser
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultTrimChars are the characters which are stripped by Trim* functions in default. DefaultTrimChars = string([]byte{ '\t', '\v', '\n', '\r', '\f', ' ', 0x00, 0x85, 0xA0, }) )
Functions ¶
func EqualFoldWithoutChars ¶
EqualFoldWithoutChars checks string `s1` and `s2` equal case-insensitively, with/without chars '-'/'_'/'.'/' '.
func IsLetterLower ¶
IsLetterLower checks whether the given byte b is in lower case.
func IsLetterUpper ¶
IsLetterUpper checks whether the given byte b is in upper case.
func IsNumeric ¶
IsNumeric checks whether the given string s is numeric. Note that float string like "123.456" is also numeric.
func NewReadCloser ¶ added in v1.0.1
func NewReadCloser(content []byte, repeatable bool) io.ReadCloser
NewReadCloser creates and returns a RepeatReadCloser object.
func NewReadCloserWithReadCloser ¶ added in v1.0.1
func NewReadCloserWithReadCloser(r io.ReadCloser, repeatable bool) (io.ReadCloser, error)
NewReadCloserWithReadCloser creates and returns a RepeatReadCloser object with given io.ReadCloser.
func RemoveSymbols ¶
RemoveSymbols removes all symbols from string and lefts only numbers and letters.
func ReplaceByMap ¶
ReplaceByMap returns a copy of `origin`, which is replaced by a map in unordered way, case-sensitively.
func SplitAndTrim ¶
SplitAndTrim splits string <str> by a string <delimiter> to an array, and calls Trim to every element of this array. It ignores the elements which are empty after Trim.
func StripSlashes ¶ added in v1.0.1
StripSlashes un-quotes a quoted string by AddSlashes.
Types ¶
type ReadCloser ¶ added in v1.0.1
type ReadCloser struct {
// contains filtered or unexported fields
}
ReadCloser implements the io.ReadCloser interface which is used for reading request body content multiple times.
Note that it cannot be closed.
func (*ReadCloser) Close ¶ added in v1.0.1
func (b *ReadCloser) Close() error
Close implements the io.ReadCloser interface.