30秒学会 Golang 片段 – Find
Returns the value of the first element in the provided collection that satisfies the provided testin...
Returns the value of the first element in the provided collection that satisfies the provided testin...
Converts a string to kebab case. Use strings.Fields() to get the words in the string, strings.Join()...
Reverses a string Use make() to create an appropriate rune slice. Use range and len() to iterate ove...
Returns true if the given number is even, false otherwise. Checks whether a number is odd or even us...
Truncates a string up to a specified length. Use len() to determine if the length is greater than l....
Converts the given value to a string. Use fmt.Sprintf() with the “%v” format specifier to convert th...
Returns the minimum value of two or more numbers. Use math.Inf(1) to set the initial minimum value t...
Converts an integer to an array of digits. Use strconv.Itoa() to convert the given number to a strin...
Initializes an integer slice in the given range (inclusive). Use make() to create a slice of appropr...
Capitalizes the first letter of a string. Use strings.ToUpper() to capitalize the first letter of th...