Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JoinWithSpecialLast ¶
JoinWithSpecialLast joins multiple strings together with a separator, except the last two, which are seperated by a different seperator.
Example (Long) ¶
package main import ( "fmt" "github.com/BytemarkHosting/bytemark-client/lib/output/morestrings" ) func main() { strs := []string{ "hi", "hello", "welcome", "good evening", } fmt.Print(morestrings.JoinWithSpecialLast(", ", " and ", strs)) }
Output: hi, hello, welcome and good evening
Example (OneString) ¶
package main import ( "fmt" "github.com/BytemarkHosting/bytemark-client/lib/output/morestrings" ) func main() { strs := []string{ "hi", } fmt.Print(morestrings.JoinWithSpecialLast(", ", " and ", strs)) }
Output: hi
Example (ThreeStrings) ¶
package main import ( "fmt" "github.com/BytemarkHosting/bytemark-client/lib/output/morestrings" ) func main() { strs := []string{ "hi", "hello", "welcome", } fmt.Print(morestrings.JoinWithSpecialLast(", ", " and ", strs)) }
Output: hi, hello and welcome
Example (TwoStrings) ¶
package main import ( "fmt" "github.com/BytemarkHosting/bytemark-client/lib/output/morestrings" ) func main() { strs := []string{ "hi", "hello", } fmt.Print(morestrings.JoinWithSpecialLast(", ", " and ", strs)) }
Output: hi and hello
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.