stringutil

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayInt16ToString

func ArrayInt16ToString(a []int16, sep string) string

func Concat

func Concat(v ...interface{}) string

func Contains

func Contains(tokens []string, src string) (ret bool)

func Cp949toUtf8

func Cp949toUtf8(src []byte) string

func CutLastString

func CutLastString(className string, delim string) string

func EscapeSpace

func EscapeSpace(a string) string

func FirstWord

func FirstWord(target, delim string) string

func HashCode

func HashCode(s string) int

2017.5.24 Java string.hashCode 함수 대체

func InArray

func InArray(str string, list []string) bool

func InArrayCaseSensitive

func InArrayCaseSensitive(str string, list []string) bool

func IsNotEmpty

func IsNotEmpty(s string) bool

func LPad

func LPad(str string, n int) string

func LPadInt

func LPadInt(v, size int) string

func LastWord

func LastWord(target, delim string) string

func NullTermToStrings

func NullTermToStrings(b []byte) (s []string)

func ParseInt32

func ParseInt32(str string) int32

func ParseInt64

func ParseInt64(str string) int64

func ParseMapSASToString

func ParseMapSASToString(m map[string][]string, maxCount, keyMaxSize, valueMaxSize int) string

func ParseStringZeroToEmpty

func ParseStringZeroToEmpty(v int64) string

func RPad

func RPad(str string, n int) string

func Split

func Split(s, sep string) []string

TODO Tckenizer, Split 테스트 필요

func StringInSlice

func StringInSlice(a string, list []string) bool

func Substring

func Substring(s string, from string, to string) string

substring

func SubstringN

func SubstringN(s string, from string, to string, n int) []string

substring

func SubstringWords

func SubstringWords(s string, from []string) map[string]string

substring Prefix "abcd efg hijk" from[]{"a","e","h"} => result[]{"abcd", "efg", "hijk"}

func ToPair

func ToPair(s string, sep string) (k, v string)

get k, v

func Tokenizer

func Tokenizer(src, delim string) []string

func TrimAllSpace

func TrimAllSpace(str string) string

func TrimEmpty

func TrimEmpty(s string) string

func Truncate

func Truncate(str string, length int) string

func TruncateRune added in v0.0.15

func TruncateRune(str string, sz int) string

Types

type StringBuffer

type StringBuffer struct {
	// contains filtered or unexported fields
}

func NewStringBuffer

func NewStringBuffer() *StringBuffer

func (*StringBuffer) Append

func (sb *StringBuffer) Append(str string) *StringBuffer

/ append a string to the tail of this buffer

func (*StringBuffer) AppendClose

func (sb *StringBuffer) AppendClose(str string) *StringBuffer

func (*StringBuffer) AppendComment

func (sb *StringBuffer) AppendComment(str string) *StringBuffer

/ append a line as comment.

func (*StringBuffer) AppendFormat

func (sb *StringBuffer) AppendFormat(str string, args ...interface{}) *StringBuffer

func (*StringBuffer) AppendLine

func (sb *StringBuffer) AppendLine(str string) *StringBuffer

func (*StringBuffer) AppendLineClose

func (sb *StringBuffer) AppendLineClose(str string) *StringBuffer

func (*StringBuffer) AppendLineIndent

func (sb *StringBuffer) AppendLineIndent(str string) *StringBuffer

func (*StringBuffer) Clear

func (sb *StringBuffer) Clear()

/ clear .

func (*StringBuffer) ToString

func (sb *StringBuffer) ToString() string

Jump to

Keyboard shortcuts

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