How to remove all occurrences of a character in a string with Go

1 Answer

0 votes
package main

import (
	"fmt"
	"strings"
)

func main() {
	str := "Go is a statically typed, compiled high-level programming language"

	str = strings.ReplaceAll(str, "a", "")

	fmt.Println(str)
}


/*
run:

Go is  stticlly typed, compiled high-level progrmming lnguge

*/

 



answered Oct 12, 2024 by avibootz
...