Skip to content

Instantly share code, notes, and snippets.

@cipepser
Created December 29, 2016 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cipepser/7aad5498729843d80b17ee165820e1c7 to your computer and use it in GitHub Desktop.
Save cipepser/7aad5498729843d80b17ee165820e1c7 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"strings"
)
func main() {
var s string = "Now I need a drink, alcoholic of course, after the heavy lectures involving quantum mechanics."
s = strings.Replace(s, ".", "", -1)
s = strings.Replace(s, ",", "", -1)
for _, n := range strings.Split(s, " ") {
fmt.Println(len(n))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment