reverse/reverse.rs
1use repl_framework::Repl;
2fn main() -> std::io::Result<()> {
3 Repl::default().with_function("", reverse).run()
4}
5#[derive(Default)]
6struct Data;
7
8// function to reverse string
9fn reverse(_: &mut Data, strings: Vec<String>) {
10 let mut outstring = String::new();
11 strings.into_iter().for_each(|string| {
12 string.chars().rev().for_each(|f| outstring.push(f));
13 outstring += " ";
14 });
15 println!("{}", outstring);
16}