Documentation
¶
Index ¶
- Constants
- type CycleString
- func (x *CycleString) At(index int) byte
- func (x *CycleString) ByteAt(index int) byte
- func (x *CycleString) CharAt(index int) rune
- func (x *CycleString) Iterator() iterator.Iterator[rune]
- func (x *CycleString) MarshalJSON() ([]byte, error)
- func (x *CycleString) RealByteLength() int
- func (x *CycleString) RealRuneLength() int
- func (x *CycleString) RuneAt(index int) rune
- func (x *CycleString) String() string
- func (x *CycleString) SubString(from, to int) string
- func (x *CycleString) SubStringRune(from, to int) string
- func (x *CycleString) UnmarshalJSON(bytes []byte) error
- type CycleStringIterator
Constants ¶
View Source
const CycleStringBaseStringJsonFieldName = "CycleStringBaseString"
CycleStringBaseStringJsonFieldName JSON序列化后存储真实字符串的字段名称,用于让序列化后的JSON能够具有一定的辨识和阅读性
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CycleString ¶
type CycleString struct {
// contains filtered or unexported fields
}
CycleString 循环字符串
func (*CycleString) ByteAt ¶
func (x *CycleString) ByteAt(index int) byte
ByteAt 获取给定下标的字节,会按照字节长度获取
func (*CycleString) Iterator ¶
func (x *CycleString) Iterator() iterator.Iterator[rune]
Iterator 返回一个当前对象的迭代器,当然这个迭代器是没有尽头的
func (*CycleString) MarshalJSON ¶
func (x *CycleString) MarshalJSON() ([]byte, error)
MarshalJSON JSON序列化
func (*CycleString) RealByteLength ¶
func (x *CycleString) RealByteLength() int
RealByteLength 返回真实的字节长度
func (*CycleString) RealRuneLength ¶
func (x *CycleString) RealRuneLength() int
RealRuneLength 返回真实的字符长度
func (*CycleString) RuneAt ¶
func (x *CycleString) RuneAt(index int) rune
RuneAt 获取给定下标的字符,会按照字符长度计算下标
func (*CycleString) SubString ¶
func (x *CycleString) SubString(from, to int) string
SubString 获取当前字符串的子字符串
func (*CycleString) SubStringRune ¶
func (x *CycleString) SubStringRune(from, to int) string
SubStringRune 字符形式的子串
func (*CycleString) UnmarshalJSON ¶
func (x *CycleString) UnmarshalJSON(bytes []byte) error
UnmarshalJSON JSON反序列化
type CycleStringIterator ¶
type CycleStringIterator struct {
// contains filtered or unexported fields
}
CycleStringIterator 用于迭代一个循环字符串
func NewCycleStringIterator ¶
func NewCycleStringIterator(cycleString *CycleString) *CycleStringIterator
NewCycleStringIterator 基于周期字符串创建一个字符串迭代器
func (*CycleStringIterator) Next ¶
func (x *CycleStringIterator) Next() bool
Next 因为是一个无限循环,所以迭代器的方法永远返回true
func (*CycleStringIterator) Value ¶
func (x *CycleStringIterator) Value() rune
Click to show internal directories.
Click to hide internal directories.