Skip to content

Golang Concatenate Strings [Efficient Way – Builder]

Ok, we have a huge amount of strings to join them to each other! and maybe from different types!

To concatenate strings efficiently my recommendation is Builder from the string package:

// Add to builder
func (b *Builder) WriteString(s string) (int, error)
func (b *Builder) WriteByte(c byte) error {

// Get the string
func (b *Builder) String() string {

package main

import (

func main() {
	strs := []string{

	strBuilder := strings.Builder{}

	for _, s := range strs {


Leave a Reply

Your email address will not be published. Required fields are marked *