# What happens when two strings are concatenated?

Concatenate produces a result that is a string composed of the right operand appended to the left operand. Concatenate gives its operands no special interpretation. It treats them as string values.

Bron: [String Concatenate (_) | ObjectScript Reference](https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_op_string#:~:text=Concatenate%20produces%20a%20result%20that,treats%20them%20as%20string%20values.)

Toegevoegd: 2026-01-26
Webpagina: https://1001vragen.nl/vraag/what-happens-when-two-strings-are-concatenated

## What happens when you concatenate two strings?

Concatenation is the process of appending one string to the end of another string. You concatenate strings by using the + operator. For string literals and string constants, concatenation occurs at compile time; no run-time concatenation occurs.

Bron: [How to concatenate multiple strings (C# Guide) - Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/csharp/how-to/concatenate-multiple-strings#:~:text=Concatenation%20is%20the%20process%20of,no%20run%2Dtime%20concatenation%20occurs.)

## Why is string concatenation bad?

Concatenation of strings have the disadvantage of needing to create a new string and allocate new memory for every concatenation! This is time consuming, but isn't that big of a deal with few and small strings.

Bron: [Is python += string concatenation bad practice? - Stack Overflow](https://stackoverflow.com/questions/39675898/is-python-string-concatenation-bad-practice/39680089)

## What is a function that concatenates two strings?

The strcat() function concatenates string2 to string1 and ends the resulting string with the null character. The strcat() function operates on null-ended strings.

Bron: [strcat() — Concatenate Strings - IBM](https://www.ibm.com/docs/en/i/7.5.0?topic=functions-strcat-concatenate-strings#:~:text=The%20strcat()%20function%20concatenates,operates%20on%20null%2Dended%20strings.)

## Verwante vragen

- [How can you concatenate two strings in Python * using the concat() method using the join() method using the & operator using the operator?](https://1001vragen.nl/vraag/how-can-you-concatenate-two-strings-in-python-using-the-concat-method-using-the-join-method-using-the-operator-using-the-operator.md)
- [Which function is used to concatenate two or more strings?](https://1001vragen.nl/vraag/which-function-is-used-to-concatenate-two-or-more-strings.md)
- [How to concatenate two strings?](https://1001vragen.nl/vraag/how-to-concatenate-two-strings.md)
- [How to CONCATENATE two string variables namely str1 and str2 in Java using another string variable var?](https://1001vragen.nl/vraag/how-to-concatenate-two-string-variables-namely-str1-and-str2-in-java-using-another-string-variable-var.md)
- [What happens if you don't specify ASC or DESC after a SQL?](https://1001vragen.nl/vraag/what-happens-if-you-don-t-specify-asc-or-desc-after-a-sql.md)
- [What happens if you win Conference League?](https://1001vragen.nl/vraag/what-happens-if-you-win-conference-league.md)
- [How to concat two values?](https://1001vragen.nl/vraag/how-to-concat-two-values.md)
- [How to concat two names in SQL?](https://1001vragen.nl/vraag/how-to-concat-two-names-in-sql.md)
- [How to concatenate two different data types in SQL?](https://1001vragen.nl/vraag/how-to-concatenate-two-different-data-types-in-sql.md)
- [Which operator is used to concatenate or join two or more settings?](https://1001vragen.nl/vraag/which-operator-is-used-to-concatenate-or-join-two-or-more-settings.md)
