Documentation
¶
Overview ¶
Package strings introduces additional utilities for dealing with strings and slices of strings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PadLeftWith ¶
PadLeftWith prepends string s with i instances of padding p.
func Split2 ¶
Split2 splits a string on the first occurrence of the given delimiter and returns the portions of the original string before and after the delimiter. If no delimiter appears in the given string, the entire string is returned as the first result and the second result is empty. If multiple delimiters appear in the string, the strings are split at the first occurrence. The delimiter may appear at the start of end of the string, resulting in either the first or second result being the empty string.
func SplitFirstColon ¶
SplitFirstColon invokes Split2 to split a string of the form "A:B".
func SplitFirstEqual ¶
SplitFirstEqual invokes Split2 to split a string of the form "A=B".
func SplitHostPort ¶
SplitHostPort splits a string of the form "host:port". After splitting the string via net.SplitHostPort, the port is converted to an integer. If there is an error splitting the host and port, if port cannot be converted into an integer, or if port is not in the range [0, 65535], an error is returned.
Types ¶
type Set ¶
Set represets set-like operations for strings.
func NewSet ¶
NewSet ccreates a new Set containing the provided strings as an initial values stored in the set.