Documentation
¶
Index ¶
- func FormatText(str string, max int, truncateWordOverMaxSize bool, indenT ...string) string
- func FormatTextParagraphFormatting(str string, max int, truncateWordOverMaxSize bool, indentFirstLinetr ...string) string
- func FormatTextQuoteBlankLines(str string) (out string)
- func GetFileEOL(filename string) (outString string, err error)
- func GetOsLineEnd() string
- func GetTextEOL(inTextBytes []byte) (outString string)
- func HtmlEscOrUnEsc(in string, options ...HtmlEscOpt) string
- func LowercaseAtFirst(inString string) bool
- func RemoveDupSpace(inString string) string
- func RemoveNonAlNum(inString string) string
- func RemoveNonNum(inString string) string
- func RemoveSpace(inString string) string
- func ReplacePunct(inString, repl string) string
- func ReplaceSpace(inString, repl string) string
- func SeparateUpper(inString, sep string) string
- func SetFileEOL(filename, eol string) error
- func SetTextEOL(inTextBytes []byte, eol string) (outTextBytes []byte, err error)
- func SplitNumeric(inString string) (outText []string, err error)
- func ToCamel(inString string, lowerAtFirst ...bool) string
- func ToKebab(inString string, allCaps ...bool) string
- func ToSnake(inString string, allCaps ...bool) string
- func TruncateString(inString, prefix string, max, option int) string
- func UnEscapeString(inString string) string
- func UnEscapedStr(in string) string
- func UnescapeToUtf8(inStr string) string
- type HtmlEscOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatText ¶
FormatText: Format words text to fit (column/windows with limited width) "max" chars. An unwanted behavior may occur on string where word's length > max...
func FormatTextParagraphFormatting ¶
func FormatTextParagraphFormatting(str string, max int, truncateWordOverMaxSize bool, indentFirstLinetr ...string) string
FormatTextParagraphFormatting:
func FormatTextQuoteBlankLines ¶
An unwanted behavior may occur on string where word's length > max...
func GetFileEOL ¶
GetFileEOL: Open file and get (CR, LF, CRLF) > string or get OS line end.
func GetTextEOL ¶
GetTextEOL: Get EOL from text bytes (CR, LF, CRLF)
func HtmlEscOrUnEsc ¶
func HtmlEscOrUnEsc(in string, options ...HtmlEscOpt) string
HtmlEscOrUnEsc: Escape or unescape to/from html, usefull for pango too.
func LowercaseAtFirst ¶
LowercaseAtFirst: true if 1st char is lowercase
func RemoveDupSpace ¶
RemoveDupSpace: Remove duplicated space/tab in string
func RemoveNonAlNum ¶
RemoveNonAlNum: Remove all non alpha-numeric char
func RemoveNonNum ¶
RemoveNonNum: Remove all non numeric char
func ReplacePunct ¶
ReplacePunct: replace all [[:punct::]] with 'repl'
func ReplaceSpace ¶
ReplaceSpace: replace all [[:space::]] with 'repl'
func SeparateUpper ¶
SeparateUpper: Add a 'sep' before each upper case char except the first.
func SetFileEOL ¶
SetFileEOL: Open file and convert EOL (CR, LF, CRLF) then write it back.
func SetTextEOL ¶
SetTextEOL: Get EOL from text bytes and convert it to another EOL (CR, LF, CRLF)
func SplitNumeric ¶
SplitNumeric: Split and keep all numeric values in a string
func TruncateString ¶
TruncateString: Reduce string length for display (prefix is separator like: "...", option=0 -> put separator at the begining of output string. Option=1 -> center, is where separation is placed. option=2 -> line feed, trunc the whole string using LF without shorting it. Max, is max char length of the output string.
func UnEscapeString ¶
UnEscapeString: Convert raw string that contain escaped values to literal string.
func UnEscapedStr ¶
UnEscapedStr: Convert raw string that contain escaped values to literal string. Same result as below.
func UnescapeToUtf8 ¶
UnescapeToUtf8: Convert raw string that contain escaped values to utf-8 literal string.