str_util

package
v0.0.0-...-e7a9558 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadText2Slice

func LoadText2Slice(text string) (result [][]string)

func LoadText2SliceMap

func LoadText2SliceMap(text string) (result []map[string]string)

func StrMd5

func StrMd5(mystr string) string

func StringToMap

func StringToMap(str string) (data map[string]string)

*

  • parse str style='width:1' class="hello" checked=on as map[style:width:1 class:hello checked:on]

Types

type TxtFile

type TxtFile struct {
	Lines []*TxtLine
}

func NewTxtFile

func NewTxtFile(path string) (*TxtFile, error)

func NewTxtFileFromString

func NewTxtFileFromString(text string) *TxtFile

func (*TxtFile) KvMapSlice

func (txt *TxtFile) KvMapSlice(splitStr string, ignoreError bool, fields map[string]string) (result []map[string]string, err error)

type TxtLine

type TxtLine struct {
	No      int
	Str     string
	Comment string
	Origin  string
}

func (*TxtLine) Empty

func (line *TxtLine) Empty() bool

func (*TxtLine) KvMap

func (line *TxtLine) KvMap(splitStr string) (result map[string]string, err error)

func (*TxtLine) Slice

func (line *TxtLine) Slice() []string

func (*TxtLine) String

func (line *TxtLine) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL