Created
July 11, 2013 21:18
-
-
Save chespinoza/5979335 to your computer and use it in GitHub Desktop.
FInding Numbers with Go
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" | |
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