30秒学会 JavaScript 片段 – mapString
Creates a new string with the results of calling a provided function on every character in the calli...
Creates a new string with the results of calling a provided function on every character in the calli...
Converts a string to title case. Break the string into words, using a regexp, and combine them capit...
Reverses a string Use make() to create an appropriate rune slice. Use range and len() to iterate ove...
Converts a color code to a rgb() or rgba() string if alpha value is provided. Use bitwise right-shif...
Parse an HTTP Cookie header string and return an object of all cookie name-value pairs. Use String.p...
Indents each line in the provided string. Use String.replace and a regular expression to add the cha...
Converts a string to camelcase. Break the string into words and combine them capitalizing the first ...
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...
Capitalizes the first letter of a string. Use string.ToCharArray() to convert the string to an array...