Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8238349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:47:02+00:00 2026-06-07T19:47:02+00:00

I only found this related to what I am looking for: Split string by

  • 0

I only found this related to what I am looking for: Split string by count of characters but it is not useful for what I mean.

I have a string variable, which is an ammount of 3 numbers (can be from 000 to 999). I need to separate each of the numbers (characters) and get them into a table.

I am programming for a game mod which uses lua, and it has some extra functions. If you could help me to make it using: http://wiki.multitheftauto.com/wiki/Split would be amazing, but any other way is ok too.

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T19:47:04+00:00Added an answer on June 7, 2026 at 7:47 pm

    Corrected to what the OP wanted to ask:

    To just split a 3-digit number in 3 numbers, that’s even easier:

    s='429'
    c1,c2,c3=s:match('(%d)(%d)(%d)')
    t={tonumber(c1),tonumber(c2),tonumber(c3)}
    

    The answer to “How do I split a long string composed of 3 digit numbers”:

    This is trivial. You might take a look at the gmatch function in the reference manual:

    s="123456789"
    res={}
    for num in s:gmatch('%d%d%d') do
        res[#res+1]=tonumber(num)
    end
    

    or if you don’t like looping:

    res={}
    s:gsub('%d%d%d',function(n)res[#res+1]=tonumber(n)end)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this question but it was only similar and, more importantly, dated by
I found only one attempt to create such compiler - http://sourceforge.net/projects/xsltc/ . But this
I have looked all around and only found solutions for python 2.6 and earlier,
I have found only two methods (SaveFile, LoadFile) which save in a file. How
Been searching but the only thing I found was http://evain.net/blog/articles/2009/07/30/rebasing-system-reactive-to-the-net-clr which I got to
The only similar question I have found is: Insert php boolean into mysql bit
NOTE: This question is only loosely related to tinyxml, however including details like that
This is something that has been troubling me lately, and i've found related questions
Well the title pretty much sums the question. The only thing I found is
I found out that HTML form supports only two enctype types. They are application/x-www-form-urlencoded

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.