Documentation ¶
Index ¶
- func ArgSplitter(input string) []string
- func Between(s, after, before string) (string, bool)
- func CheckPrefixes(text string, prefixes []string) int
- func CombineUntil(s []string, max int, sep string) []string
- func FormatterThing(s string) string
- func GetDateString() string
- func GetRFC3339DateString() string
- func GetTimeDateString() string
- func GetTimeString() string
- func IndexRemover(args []string, remove ...int) []string
- func Prepend(s string, r []string) []string
- func RemoveFromSliceString(s []string, pos int) []string
- func SortByLongestFirst(s []string) []string
- func SplitLength(s string, max int, sep string) []string
- func StrrayToStr(seperator string, a ...string) (b string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArgSplitter ¶
ArgSplitter is used to split a string into an array of strings using whitespace as a seperator, while also taking into account quotes and escapes
func Between ¶
Between returns the contents of a string between before and after, yes its messy but it works
func CheckPrefixes ¶
CheckPrefixes checks if a message contains any of the prefixes listed in a string array This function automatically converts the message to lowercase, thus the prefix check is case insensitive and all given prefixes must be in lowercase Returns the length of the prefix if true, returns -1 if false, if the text is the same lenght as the prefix it will also return -1
func CombineUntil ¶
CombineUntil uses similar logic to SplitLenght, except that it takes an array of strings directly rather than splitting them itself it essentially tries to combine the input strings until its as close to max length but not over, and returns an array of strings which are combined from s to be as close to max
func FormatterThing ¶
FormatterThing does some really basic formatting on a string, replacing spaces with linebreaks and adding indentation based off of {} brackets
func GetDateString ¶
func GetDateString() string
GetDateString , Returns a string of the Current date in YYYY-MM-DD format
func GetRFC3339DateString ¶
func GetRFC3339DateString() string
GetRFC3339DateString , Returns the current time in RFC3339 Standardised Format
func GetTimeDateString ¶
func GetTimeDateString() string
GetTimeDateString , Returns a string of the date and time using GetDateString and GetTimeString seperated by an underscore
func GetTimeString ¶
func GetTimeString() string
GetTimeString , Returns a string of the current time in 24h HH:MM:SS format
func IndexRemover ¶
IndexRemover returns a new array of strings containing the contents of args but with any of the marked indexes removed
func RemoveFromSliceString ¶
RemoveFromSliceString removes an index from a slice of strings
func SortByLongestFirst ¶
SortByLongestFirst sorts an array of strings by their length, placing the longest first
func SplitLength ¶
SplitLength is similar to strings.SplitAfter except it only splits on sep when a string exceedes a certain max length, the splitting behaviour attemps to keep all returned strings as close to but below the max lenght. note that as it only splits on instances of seperator any segment larger than the max that does not contain sep will remain intact and thus will be larger than max, as such the string length is not gaurenteed to be below the max.
func StrrayToStr ¶
StrrayToStr converts any amount of strings into a single string
Types ¶
This section is empty.