Quantcast
Viewing all articles
Browse latest Browse all 3

How do I remove line feeds / line breaks from std::string::String?

I cannot find something that will do this. What I have so far is only for whitespace:

pub fn minify(&self) {
    println!("Minify task started ... ");
    let mut string_iter = self.mystring.split_whitespace();
    for strings in string_iter {
        println!("{}", strings);
    }
}

mystring is something like:

let mystring = "p {
                  text-align: center;
                  color: red;
                } ";

Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>