gobyexample/linefilter/linefilter.go

22 lines
248 B
Go
Raw Permalink Normal View History

2024-05-03 11:32:30 +00:00
package linefilter
import (
"bufio"
"fmt"
"os"
"strings"
)
func LineFilter() {
sc := bufio.NewScanner(os.Stdin)
for sc.Scan() {
cap := strings.ToUpper(sc.Text())
fmt.Println(cap)
}
if err := sc.Err(); err != nil {
panic(err)
}
}