Compare string concat methods #48

Open
opened 2026-09-08 18:01:34 -04:00 by kevintl1998 · 1 comment
Owner

Lua has two methods to concatenate strings. .. and string.format. Look up what the differences are and adjust code accordingly.

Lua has two methods to concatenate strings. `..` and `string.format`. Look up what the differences are and adjust code accordingly.
kevintl1998 added this to the Release 1.0 milestone 2026-09-08 18:01:49 -04:00
Author
Owner

Concatination using .. Creates a new string instance since lua string are immutable. source

When combining large strings or many strings into one large string, use table.concat. source

Otherwise for smaller string concats, the .. operator will suffice.

Concatination using `..` Creates a new string instance since lua string are immutable. [source](https://stackoverflow.com/questions/1405583/concatenation-of-strings-in-lua) When combining large strings or many strings into one large string, use table.concat. [source](https://stackoverflow.com/questions/19138974/does-lua-optimize-the-operator) Otherwise for smaller string concats, the `..` operator will suffice.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kevintl1998/yapp.nvim#48
No description provided.