Splitting Numbers Into A Table
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 2
- Joined: Sat Apr 16, 2022 5:22 pm
Splitting Numbers Into A Table
I want to put a number (or a string would be fine) and I want to separate each character and put it as its own value in a table. Help would be great thanks!
- BrotSagtMist
- Party member
- Posts: 657
- Joined: Fri Aug 06, 2021 10:30 pm
Re: Splitting Numbers Into A Table
Code: Select all
s="artnsieniasoghccep9876k"
t={}
for x=1,#s do t[x]=sring.sub(s,x,x) end
obey
Re: Splitting Numbers Into A Table
Almost all questions are on the stackoverflow:TheDirtMan wrote: ↑Sat Apr 16, 2022 5:25 pm I want to put a number (or a string would be fine) and I want to separate each character and put it as its own value in a table. Help would be great thanks!
https://stackoverflow.com/questions/204 ... g-to-table
Re: Splitting Numbers Into A Table
Tip: When searching for help with Love, unless you're using a love.?? function, it's probably actually a question about Lua. That's been really helpful for me personally, as I didn't know Lua before migrating to Love.
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
-
- Prole
- Posts: 2
- Joined: Sat Apr 16, 2022 5:22 pm
Re: Splitting Numbers Into A Table
Thanks to both of you, i will check stackoverflow from now on instead of posting here
- BrotSagtMist
- Party member
- Posts: 657
- Joined: Fri Aug 06, 2021 10:30 pm
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 3 guests