Documentation ¶
Index ¶
- func ConsumePrefix(s *string, prefix string) bool
- func ConsumeSuffix(s *string, suffix string) bool
- func OrDefault(s, defaultValue string) string
- func PointerOrDefault(s *string, defaultValue string) string
- func Repeat(s string, n int) string
- func Split2(str, sep string) (string, string)
- func Ternary(condition bool, ifTrue, ifFalse string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConsumePrefix ¶
ConsumePrefix checks if *s has the given prefix, and if yes, modifies it to remove the prefix. The return value indicates whether the original string had the given prefix.
func ConsumeSuffix ¶
ConsumeSuffix checks if *s has the given suffix, and if yes, modifies it to remove the suffix. The return value indicates whether the original string had the given suffix.
func PointerOrDefault ¶
PointerOrDefault returns the string if it's not nil nor empty, or the default.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.