|
| 02 Feb 2017 10:04 AM |
table = {"Hey","How","Are","You?"}
Instead of:
for i,v in pairs(table) do print(v) wait() end
How can I print them all together like: "Hey How Are You?"
I'd like to put it in a variable somehow.
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 02 Feb 2017 10:05 AM |
What are you doing this for those? If this is for saving data then you are doing it wrong.
|
|
|
| Report Abuse |
|
|
|
| 02 Feb 2017 10:07 AM |
I'm not saving data. I'm using WebHook on discord. It's just I had to take out words because inside of a table I had number values.
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
|
| 02 Feb 2017 10:08 AM |
You saved me a load of trouble. Thanks!
|
|
|
| Report Abuse |
|
|
|
| 02 Feb 2017 10:11 AM |
tabble={"Hey","How","Are","You?") zomg='' for i,v in pairs(tabble)do zomg=zomg..v..' ';end print(zomg) |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 02 Feb 2017 11:35 AM |
| Why do people post such idiotic and/or wrong solutions after someone posted the correct one? I never understood that about this subforum... |
|
|
| Report Abuse |
|
|
|
| 02 Feb 2017 05:13 PM |
Theres a function called unpack which prints the contents of a tableyou idiot.
"Wrong solution"
Lmao |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 02 Feb 2017 05:15 PM |
"Theres a function called unpack which prints the contents of a tableyou idiot." Wrong, that's not what unpack does. Nice job calling me an idiot my dear insecure skid.
And time's solution is far better than using yours lmao. |
|
|
| Report Abuse |
|
|
|
| 02 Feb 2017 05:17 PM |
"I'd like to put it in a variable somehow. " unpack does not do that |
|
|
| Report Abuse |
|
|
|
| 02 Feb 2017 05:18 PM |
lemme just repeat what you said
"Wrong solution"
I was just giving another way of doing it.
now dont waste my time |
|
|
| Report Abuse |
|
|
|
| 02 Feb 2017 05:18 PM |
^
Never call cntkillme stupid |
|
|
| Report Abuse |
|
|
|
| 02 Feb 2017 05:22 PM |
Because doing dumb stuff is fun, cnt.
local strings = {"a", "b", "c", "d"}
setmetatable(strings, { __call = function(self, ...) return string.concat(self) .. string.concat({...}) end })
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 02 Feb 2017 06:40 PM |
"lemme just repeat what you said 'Wrong solution' I was just giving another way of doing it."
Your way sucks and doesn't solve OP's "I'd like to put it in a variable somehow." so yes, in that regard it's WRONG.
@cody hello icyfires |
|
|
| Report Abuse |
|
|