You might want to do something like this, with the Iterator::enumerate method. This will print a newline after the first word in each line:
for (pos, a) in sne.enumerate() {
print!("{} ",m[index]);
index+=1;
if pos == 0 {
print!("\n")
}
}
index 0 is the first element, not the last element. If you want to print a newline after the last word in each line, you can put a print! statement after the loop instead:
for a in sne {
print!("{} ",m[index]);
index+=1;
}
print!("\n")
Thanks @mbrubeck , but you know the solution would be same and I am really proud of what I made and i also fixed the issue by creating another vector and having all the case sensitive words in it and to print new line I just did (vector name = ls)
if a == ls[ls.len() - 1] { print!("\n") }
And Thanks Again
But If you like you could reply on another topic like this to help me out
And on that topic I am just asking you to give me ideas for projects that would help me make myself comfortable with rust.