Home Forums General Programming string.sub?

This topic contains 1 reply, has 1 voice, and was last updated by  human fly 1 week, 2 days ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #81876

    human fly

    i want to use string.sub to get the number at the end of
    a name (suffix). if i do:
    it is ok for numbers 0-9, but i can’t get numbers/suffixes
    with more than one character – ie: i need 1-24, names are
    ‘pad1’ to ‘pad24’

    i tried numbering 01-24 but it hasn’t been working for some
    reason (although i think it did previously, going to try again).

    any workarounds for this?


    human fly

    aaaah… figured it out: i was counting from the end
    when i didn’t need to. as the names are ‘pad’..n, all
    i had to do was count from the beginning of the name,eh.
    so that’s:
    and no need to try to number 01,02,etc. as that cannot
    match for i=1,24
    duh, simple solutions.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Comments are closed.