• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Get text and number from string

ntmr

hi!
Senator
Joined
Jul 7, 2007
Messages
1,835
Reaction score
15
Location
Santa Catarina, Brazil
Hello.

Is there any way to separate text and numbers from a string?

Example:

I have the string "God Lipe45854882" and I wnat to separate this in "God Lipe" and "45854882".

Is there any way to do this in LUA?


-----------------

Another question:

Is there any way to make a talkaction with 2 parameters?

Example:

The talkaction !givemoney "God Lipe, 100

Thanks :thumbup:
 
In your example, this would work:

Code:
string = "God Lipe45854882"
i = string.find(string,"%d")
name = string.sub(string,0,i-1)
number = string.sub(string,i)
 
Back
Top