mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
417 B
25 lines
417 B
5 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"github.com/01-edu/z01"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
if len(os.Args) <= 1 || len(os.Args) > 4 {
|
||
|
z01.PrintRune('\n')
|
||
|
} else if len(os.Args) == 4 {
|
||
|
array := []rune(os.Args[1])
|
||
|
search := []rune(os.Args[2])
|
||
|
replace := []rune(os.Args[3])
|
||
|
for _, val := range array {
|
||
|
if val == search[0] {
|
||
|
z01.PrintRune(replace[0])
|
||
|
} else {
|
||
|
z01.PrintRune(val)
|
||
|
}
|
||
|
}
|
||
|
z01.PrintRune('\n')
|
||
|
}
|
||
|
}
|