()
| 7 | ) |
| 8 | |
| 9 | func main() { |
| 10 | |
| 11 | strBetween := stringy.New("HelloMyName") |
| 12 | fmt.Println(strBetween.Between("hello", "name").ToUpper()) |
| 13 | |
| 14 | teaseString := stringy.New("Hello My name is Roshan. I am full stack developer") |
| 15 | fmt.Println(teaseString.Tease(20, "...")) |
| 16 | |
| 17 | replaceFirst := stringy.New("Hello My name is Roshan and his name is Alis.") |
| 18 | fmt.Println(replaceFirst.ReplaceFirst("name", "nombre")) |
| 19 | |
| 20 | replaceLast := stringy.New("Hello My name is Roshan and his name is Alis.") |
| 21 | fmt.Println(replaceLast.ReplaceLast("name", "nombre")) |
| 22 | |
| 23 | snakeCase := stringy.New("ThisIsOne___messed up string. Can we Really Snake Case It?") |
| 24 | fmt.Println(snakeCase.SnakeCase("?", "").Get()) |
| 25 | fmt.Println(snakeCase.SnakeCase("?", "").ToUpper()) |
| 26 | fmt.Println(snakeCase.SnakeCase("?", "").ToLower()) |
| 27 | |
| 28 | camelCase := stringy.New("ThisIsOne___messed up string. Can we Really camel-case It ?##") |
| 29 | fmt.Println(camelCase.CamelCase("?", "", "#", "").Get()) |
| 30 | |
| 31 | delimiterString := stringy.New("ThisIsOne___messed up string. Can we Really delimeter-case It?") |
| 32 | fmt.Println(delimiterString.Delimited("?").Get()) |
| 33 | |
| 34 | contains := stringy.New("hello mam how are you??") |
| 35 | fmt.Println(contains.ContainsAll("mams", "?")) |
| 36 | |
| 37 | lines := stringy.New("fòô\r\nbàř\nyolo123") |
| 38 | fmt.Println(lines.Lines()) |
| 39 | |
| 40 | reverse := stringy.New("This is only test") |
| 41 | fmt.Println(reverse.Reverse()) |
| 42 | |
| 43 | pad := stringy.New("Roshan") |
| 44 | fmt.Println(pad.Pad(10, "0", "both")) |
| 45 | fmt.Println(pad.Pad(10, "0", "left")) |
| 46 | fmt.Println(pad.Pad(10, "0", "right")) |
| 47 | |
| 48 | shuffleString := stringy.New("roshan") |
| 49 | fmt.Println(shuffleString.Shuffle()) |
| 50 | |
| 51 | cleanString := stringy.New("special@#remove%%%%") |
| 52 | fmt.Println(cleanString.RemoveSpecialCharacter()) |
| 53 | |
| 54 | boolString := stringy.New("off") |
| 55 | fmt.Println(boolString.Boolean()) |
| 56 | |
| 57 | surroundStr := stringy.New("__") |
| 58 | fmt.Println(surroundStr.Surround("-")) |
| 59 | |
| 60 | str := stringy.New("hello__man how-Are you??") |
| 61 | result := str.CamelCase("?", "").Get() |
| 62 | fmt.Println(result) // HelloManHowAreYou |
| 63 | |
| 64 | snakeStr := str.SnakeCase("?", "") |
| 65 | fmt.Println(snakeStr.ToLower()) // hello_man_how_are_you |
| 66 |
nothing calls this directly
no test coverage detected
searching dependent graphs…