Russia has invaded Ukraine and already killed tens of thousands of civilians, with many more raped or tortured. It's a
genocide
. We need your help. Let's fight back against the Russian regime.
Help Ukraine! Fight the Russian regime!
GOSAMPLES
All
Shorts
strings
Learn how to work with strings in Go
Please consider supporting us by disabling your ad blocker
π Convert string to bool in Go
Learn how to parse a string as a bool
introduction
strings
bool
September 30, 2021
π― Remove duplicate spaces from a string in Go
Learn how to remove all redundant whitespaces from a string
introduction
strings
regex
September 29, 2021
π° String padding in Go
Learn how to print aligned strings padded with spaces
introduction
strings
format
August 27, 2021
π Compare two slices in Go
Learn how to check if two slices are equal
introduction
slice
strings
August 24, 2021
π£ Print struct variables in Go
Learn how to print struct with variable names
introduction
strings
go-spew
August 20, 2021
βοΈ Convert interface to string in Go
Learn how to format any value as a string
introduction
interface
strings
August 12, 2021
ποΈ 3 ways to pretty print JSON in Go
Learn how to generate JSON with indentation
introduction
json
strings
August 3, 2021
πΊοΈ Convert map to JSON in Go
Learn how to convert map to JSON string
introduction
json
strings
August 1, 2021
π Case-insensitive string comparison in Go
Learn how to compare strings in a case-insensitive manner
introduction
strings
May 25, 2021
π Check if a string starts with a substring in Go
Learn how to use strings.HasPrefix() function
introduction
strings
May 11, 2021
1
...
2
...
3