How do I trim whitespace and specific characters?

This is an example of how to trim whitespace and specific characters in Go. You can use the `strings` package to accomplish this.

            package main

            import (
                "fmt"
                "strings"
            )

            func main() {
                str := "  Hello, Go!  "
                trimmedStr := strings.TrimSpace(str) // Removes whitespace from both ends
                fmt.Println(trimmedStr)

                // To trim specific characters
                customStr := "!!!Hello, Go!!!"
                trimmedCustomStr := strings.Trim(customStr, "!") // Removes '!' from both ends
                fmt.Println(trimmedCustomStr)
            }
        

trim whitespace strings Go language programming