Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "os"
- "github.com/01-edu/z01"
- )
- func main() {
- input := os.Args[1:]
- if len(input) == 3 {
- inputText := input[0]
- inputTextRune := []rune(inputText)
- firstArg := input[1]
- firstArgRune := []rune(firstArg)
- secondArg := input[2]
- secondArgRune := []rune(secondArg)
- for i := 0; i < len(inputTextRune); i++ {
- if inputTextRune[i] == firstArgRune[0] {
- inputTextRune[i] = secondArgRune[0]
- }
- }
- for _, val := range inputTextRune {
- z01.PrintRune(val)
- }
- }
- z01.PrintRune('\n')
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement