Question about Strings

Hello,

When you add on some new text to an existing string, does Xojo simply add on to the current string in memory, … or does Xojo dump the previous string and recreate a brand new string, combining the values together?

The reason for asking is because in Java (a different language, I know), they teach students to not “add” strings together (as it’s really inefficient), but instead, to use what is called a StringBuilder, which is far faster. I didn’t know if this same principle applies to Xojo for processing text data. :slight_smile:

Thoughts?

Byron

strings are immutable so it takes the old contents and the addition and creates a new string and gets rid of the old one

there’s no “string builder” built in like Java’s
BUT an array you just add pieces to the use Join() on is pretty fast

Thank you! That makes a lot of sense… Will do! :slight_smile: