Remove All Whitespace in Go

Posted by yhuang
Public (Editable by Users)
Go
Edit
package main

import (
  "strings"
  "fmt"
)

func main() {
  s := "Some string with  \n\t whitespace"
  fmt.Println(strings.Join(strings.Fields(s),""))
}