Documentation
¶
Overview ¶
Package format contains functions that format numeric values.
Index ¶
- func FromGmailFilterNames(s string) string
- func GetDomainNames(s string) (retval string)
- func GetTopLevelDomains(s string) (retval string)
- func MakeSet(list []string) (retval []string)
- func NumSpace(s string) string
- func Reverse(s string) string
- func Reverse2(s string) string
- func Reverse3(s string) string
- func Reverse4(s string) string
- func Reverse5(s string) string
- func ReverseRune(s string) string
- func ToGmailFilterNames(s string) string
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromGmailFilterNames ¶ added in v0.3.2
FromGmailFilterNames removes the " OR " separators between elements in the gmail filters sender list
func GetDomainNames ¶ added in v0.3.2
func GetTopLevelDomains ¶ added in v0.3.2
func NumSpace ¶
NumSpace formats numeric values for readability by adding spaces every three digits.
e.g.
12345678.87654321 e-42
first, split off any exponent from the mantissa
12345678.87654321 and e-42
next, split off any decimal part from the integer part
12345678 and .87654321
next, add spaces between digits in the integer part
12 345 678 and .876 543 21
finally, add any exponent back to the mantissa
func Reverse ¶
Reverse is not utf8 compatible ... focus on
utf8.DecodeRuneInString(s string) (r rune, size int)
func Reverse2 ¶
Reverse2 reverses Reference: https://stackoverflow.com/questions/1752414/how-to-reverse-a-string-in-go
func Reverse3 ¶
Reverse3 reverses Reference: https://stackoverflow.com/a/1754209
func ReverseRune ¶
ReverseRune returns a string with the runes of s in reverse order. Invalid UTF-8 sequences, if any, will be reversed byte by byte.
Example ¶
fmt.Println(input) fmt.Println(ReverseRune(input))
Output: The quick brown 狐 jumped over the lazy 犬 犬 yzal eht revo depmuj 狐 nworb kciuq ehT
func ToGmailFilterNames ¶ added in v0.3.2
ToGmailFilterNames removes the " OR " separators between elements in the gmail filters sender list
Types ¶
This section is empty.