Created
December 29, 2016 07:53
-
-
Save cipepser/7aad5498729843d80b17ee165820e1c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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