Is there a counterpart of str::trim_matches()?

⚓ Rust    📅 2026-03-17    👤 surdeus    👁️ 2      

surdeus

I frequently use the function and it works pretty well. However, when I need to do an opposite job and put a string in quotes, I use something like:

format!(r#""{str}""#);

I am curious what do you use for the task?

3 posts - 3 participants

Read full topic

🏷️ Rust_feed