Skip to main content

reverse_words

Function reverse_words 

Source
pub fn reverse_words(s: &str) -> String
Expand description

So’zlar tartibini teskari qiladi (“Men Rust yaxshi ko’raman” → “ko’raman yaxshi Rust Men”).

§Misol

use rust_algorithms::other::strings::reverse_words;

assert_eq!(reverse_words("Men Rustni yaxshi ko'raman"), "ko'raman yaxshi Rustni Men");
assert_eq!(reverse_words("  bir   ikki  "), "ikki bir");