Written for a coding challenge, string_reverse reverse a given number of sentences. Written in Go, it uses flags and can read and write files.
go run main.go
to run.
First input should be a number of sentences to read. Following lines should be the sentences to reverse.
-i input.txt
or -input input.txt
to read input from a file instead of the command line.
-o output.txt
or -output output.txt
to output to a file instead of the command line.
3
this is a test
this is an even longer test sentence
one
Case #1: test a is this
Case #2: sentence test longer even an is this
Case #3: one