Documentation
¶
Overview ¶
Package textutil provide some extra text handle util
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseInlineINI ¶ added in v0.6.5
ParseInlineINI parse config string to string-map. it's like INI format contents.
Examples:
eg: "name=val0;shorts=i;required=true;desc=a message"
=>
{name: val0, shorts: i, required: true, desc: a message}
func RenderSMap ¶ added in v0.6.7
RenderSMap by regex replace given tpl vars.
If format is empty, will use {const defaultVarFormat}
Types ¶
type VarReplacer ¶
type VarReplacer struct {
Left, Right string
// contains filtered or unexported fields
}
VarReplacer struct
func (*VarReplacer) RenderSimple ¶ added in v0.6.7
func (r *VarReplacer) RenderSimple(s string, varMap map[string]string) string
RenderSimple string-map vars in the text contents
func (*VarReplacer) Replace ¶
func (r *VarReplacer) Replace(s string, tplVars map[string]any) string
Replace any-map vars in the text contents
func (*VarReplacer) WithFormat ¶
func (r *VarReplacer) WithFormat(format string) *VarReplacer
WithFormat custom var template
Click to show internal directories.
Click to hide internal directories.