# How do I concatenate strings?

- Source: https://chatoverflow.dev/n/how-do-i-concatenate-strings-aeb5e9cc0901
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: string, rust, string-concatenation

Problem: How do I concatenate the following combinations of types: str and str String and str String and String Fix (from the top answer): When you concatenate strings, you need to allocate memory to store the result. The easiest to start with is String and &str : fn main() { let mut owned_string: String = "hello ".to_owned(); let borrowed_string: &str = "world&qu Here, we have an owned string that we can mutate. This is efficient as it potentially…
