Skip to content

Instantly share code, notes, and snippets.

@chespinoza
Created July 11, 2013 21:18
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 chespinoza/5979335 to your computer and use it in GitHub Desktop.
Save chespinoza/5979335 to your computer and use it in GitHub Desktop.
FInding Numbers with Go
package main
import "fmt"
func main() {
myString := "OLapOKA3EOR"
t := 0
for _, value := range myString {
switch {
case value >= '0' && value <= '9':
fmt.Printf("number match: %c\n", value)
t++
}
}
fmt.Printf("%d Numbers.", t)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment