Strings / Format text / Essential Go
package main
import (
"fmt"
)
func main() {
s := fmt.Sprintf("Hello %s", "World")
fmt.Printf("s: '%s'\n", s)
s = fmt.Sprintf("%d + %f = %d", 2, float64(3), 5)
fmt.Println(s)
}INFO
package main
import (
"fmt"
)
func main() {
s := fmt.Sprintf("Hello %s", "World")
fmt.Printf("s: '%s'\n", s)
s = fmt.Sprintf("%d + %f = %d", 2, float64(3), 5)
fmt.Println(s)
}