Documentation ¶
Overview ¶
in this package, we look into an efficient and inefficient way of doing the same function.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EfficientWay ¶
EfficientWay takes in a slice of strings to be joined and returns the joined string in an Efficient way by utilizing a function in the standard package strings.Join([]string) string
Example ¶
str := "Johnny Johnny Yes Papa" slices := strings.Split(str, " ") str = InefficientWay(slices) fmt.Println(str)
Output: Johnny Johnny Yes Papa
func InefficientWay ¶
InefficientWay takes in a slice of strings to be joined and returns the joined string in an inefficient way.
Example ¶
str := "Johnny Johnny Yes Papa" slices := strings.Split(str, " ") str = EfficientWay(slices) fmt.Println(str)
Output: Johnny Johnny Yes Papa
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.