• Concatenation.
    7 replies, posted
I have seen this term and didn't really know what it is so I have been looking into it. All I have came up with is that its the term used when you paste to strings together. Am I right, or is there a better answer?
[quote=Wikipedia]In computer programming, string concatenation is the operation of joining two character strings end to end. For example, the strings "snow" and "ball" may be concatenated to give "snowball". In many programming languages, string concatenation is a binary infix operator.[/quote] In Lua, the concatenation operator is .. [lua]local str = str1 .. "another string"[/lua]
So it's like 2 strings in 1?
Sort of. The result is just the two strings glued together. If you have MyString = "Bill" .. "Bob" in Lua, it'll concatenate "Bill" and "Bob", and the value of MyString will become "BillBob".
[url=http://wordnetweb.princeton.edu/perl/webwn?s=concatenate]"add by linking or joining so as to form a chain or series"[/url] It joins together strings ( or numbers ), in the order you specify. If your data is not a string or number, you need to convert the object to a string with tostring( whatever ).
I love how "I Fail At Lua" rated me dumb while I was asking a question. Anyways I understand it now, thanks.
Its just weird that someone who posts in the lua section for quite a time asks how to concat strings in lua...
It's because I look into things that I want to know or just don't care about certain things that don't pertain to the things I am doing
Sorry, you need to Log In to post a reply to this thread.