Replace numbers by zero from string

In this example we replace any number of 1 or 2 digit by 0.
package main

import "fmt"

func main() {
	str := "abc123465@ahsjf222"
	newStr := make([]rune, len(str))
	i, added := 0, false
	for _, r := range str {
		if r >= '0' && r <= '9' {
			if added {
				continue
			}
			added, newStr[i] = true, '0'
		} else {
			added, newStr[i] = false, r
		}
		i++
	}
	fmt.Println(string(newStr[:i]))
}
C:\golang\coding>go run example12.go
abc0@ahsjf0

C:\golang\coding>

Thanks for reading. Please leave your valuable feedback and comments.

* Required Fields