gbkutil

package
v0.0.0-...-670284f Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToUTF8

func BytesToUTF8(gbkBytes []byte) string

GBK字节数组转UTF8

func FromUTF8

func FromUTF8(utf8Str string) string

UTF8字符串转GBK

func FromUTF8Bytes

func FromUTF8Bytes(utf8Bytes []byte) string

UTF8字节数组转GBK

func PadCenter

func PadCenter(s string, width int, pad string) (ret string)

居中对齐不足补充指定字符串

func PadCenterSpace

func PadCenterSpace(s string, width int) string

剧中对齐不足补充空格

func PadLeft

func PadLeft(s string, width int, pad string) string

左对齐不足补充指定字符串

func PadLeftSpace

func PadLeftSpace(s string, width int) string

左对齐不足补充空格

func PadRight

func PadRight(s string, width int, pad string) string

右对齐不足补充指定字符串

func PadRightSpace

func PadRightSpace(s string, width int) string

右对齐不足补充空格

func RuneLen

func RuneLen(s string) (ret int)

查询GBK字符混合长度

func ToUTF8

func ToUTF8(gbkStr string) string

GBK字符串转UTF8

Types

type ColumnAlign

type ColumnAlign int
const (
	ColumnAlignLeft   ColumnAlign = 0
	ColumnAlignRight  ColumnAlign = 1
	ColumnAlignCenter ColumnAlign = 2
)

type Columnize

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

func NewColumnize

func NewColumnize() *Columnize

func NewColumnizeHideBorder

func NewColumnizeHideBorder() *Columnize

func (*Columnize) AddRow

func (col *Columnize) AddRow(row []string)

func (*Columnize) SetColumnMasks

func (col *Columnize) SetColumnMasks(columnMasks []string)

func (*Columnize) SetColumns

func (col *Columnize) SetColumns(columns []string)

func (*Columnize) SetRows

func (col *Columnize) SetRows(rows [][]string)

func (*Columnize) SetShowBorder

func (col *Columnize) SetShowBorder(isShowBorder bool)

设置是否显示边框

func (*Columnize) SetTitle

func (col *Columnize) SetTitle(title string)

func (*Columnize) String

func (col *Columnize) String() string

Jump to

Keyboard shortcuts

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