Compare commits

...

7 Commits

Author SHA1 Message Date
Hamza elkhatri 2e5ee3091e
change usage and rewrite subjects 2 years ago
Hamza elkhatri 07034381da
Update README.md 2 years ago
Hamza elkhatri 368da4a0f1
Update README.md 2 years ago
Hamza elkhatri a4ccd1bd2e
Update README.md 2 years ago
Hamza elkhatri 06b64ee1ee
Update README.md 2 years ago
Hamza elkhatri 9a0f471812
Update README.md 2 years ago
hamza 17c1961804 subject(swapName):add readme 2 years ago
  1. 26
      subjects/swapname/README.md

26
subjects/swapname/README.md

@ -0,0 +1,26 @@
## swap-name
### Instructions
Write a program that takes a first and last name as one argument and swaps them.
- If there is more than one argument, nothing should be printed.
- The argument should contain only alphabetic characters and spaces and only two words, if not, you have to print `"Error\n"`
- The result must be followed with a new line at the end (`'\n'`).
- Trim any extra space in the beginning or end of the string.
### Usage
```console
$ go run . | cat -e
$ go run . "James Carl" "Peter Lab" | cat -e
$ go run . "ROB carlos" | cat -e
carlos ROB$
$ go run . "He2 $%hello" | cat -e
Error$
$ go run . " JULIE BIRD " | cat -e
BIRD JULIE$
$ go run . "Carl Jon Mic" | cat -e
Error$
$ go run . "ROB" | cat -e
Error$
```
Loading…
Cancel
Save