30秒学会 Golang 片段 – Any
Returns true if at least one element in the collection passes the test implemented by the provided f...
Returns true if at least one element in the collection passes the test implemented by the provided f...
Returns the maximum value of two or more numbers. Use math.Inf(-1) to set the initial maximum value ...
Returns the median of a collection of numbers. Find the midpoint and convert it to an integer, use s...
Indents each line in the provided string. Use strings.Replace() to prepend i to each line.
Returns the least common multiple of two or more numbers. Define a gcd() function that determines th...
Returns a string with whitespaces compacted. Use Regexp.MatchString() with a regular expression to c...
Converts a string to snake case. Use strings.Fields() to get the words in the string, strings.Join()...
Decapitalizes the first letter of a string. Use strings.ToLower() to decapitalize the first letter o...
Checks if the given number falls within the given range. Use math.Min() and math.Max() to determine ...
Concatenates two slices. Implement an appropriate function for each type. Use append() and the fact ...