Documentation ¶
Overview ¶
Package sfmt stands for string format, this package provided simple utilities to convert any supported string format -spaced|dashed|doted|underscored|camelcased- to any supperted string format -spaced|dashed|doted|underscored|camelcased.
All string's characters are first convert to lower case before processing, so the result string is a lower cased formated string.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CamelCased ¶
CamelCased convert any string format to underscored format, first letter is lowercase.
Example ¶
fmt.Println(sfmt.CamelCased("The_quick_brown_fox_jumps_over_the_lazy_dog"))
Output: theQuickBrownFoxJumpsOverTheLazyDog
func Dashed ¶
Dashed convert any string format to dashed format, all output letters are lowercase.
Example ¶
fmt.Println(sfmt.Dashed("The quick brown fox jumps over the lazy dog"))
Output: the-quick-brown-fox-jumps-over-the-lazy-dog
func Doted ¶
Doted convert any string format to doted format, all output letters are lowercase.
Example ¶
fmt.Println(sfmt.Doted("The-quick-brown-fox-jumps-over-the-lazy-dog"))
Output: the.quick.brown.fox.jumps.over.the.lazy.dog
func Spaced ¶
Spaced convert any string format to spaced format, all output letters are lowercase.
Example ¶
fmt.Println(sfmt.Spaced("The.quick.brown.fox.jumps.over.the.lazy.dog"))
Output: the quick brown fox jumps over the lazy dog
func Underscored ¶
Underscored convert any string format to underscored format, all output letters are lowercase.
Example ¶
fmt.Println(sfmt.Underscored("TheQuickBrownFoxJumpsOverTheLazyDog"))
Output: the_quick_brown_fox_jumps_over_the_lazy_dog
Types ¶
This section is empty.