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.
 
 
 
 

621 B

nruneprog

Instructions

Write a function that returns the nth rune of a string.

Expected output :

student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 2
e
student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 4 | cat -e
l$
student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 5
o
student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello"
student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" f | cat -e
"f" is not an integer value$
student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 9
Invalid position: "9" in "hello"
student@ubuntu:~/piscine-go/nruneprog$