Cookies management by TermsFeed Cookie Consent
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!


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

πŸ‘― Remove duplicate spaces from a string in Go

Learn how to remove all redundant whitespaces from a string
introduction strings regex

πŸ“° String padding in Go

Learn how to print aligned strings padded with spaces
introduction strings format

πŸ• Compare two slices in Go

Learn how to check if two slices are equal
introduction slice strings

πŸ‘£ Print struct variables in Go

Learn how to print struct with variable names
introduction strings go-spew

βš™οΈ Convert interface to string in Go

Learn how to format any value as a string
introduction interface strings

πŸ—ƒοΈ 3 ways to pretty print JSON in Go

Learn how to generate JSON with indentation
introduction json strings

πŸ—ΊοΈ Convert map to JSON in Go

Learn how to convert map to JSON string
introduction json strings

πŸ™Œ Case-insensitive string comparison in Go

Learn how to compare strings in a case-insensitive manner
introduction strings

🏁 Check if a string starts with a substring in Go

Learn how to use strings.HasPrefix() function
introduction strings
1 ... 2 ... 3