Jump to content

string question


iPanda

Recommended Posts

You've got several options: (two given down below)

  
local example = "example_string124" 
local parts = split(example, "_") -- This splits the above string into: example and string124 and creates a table that contains both new strings 
for i,v in ipairs(parts) do 
    print(v) 
end 
-- 
local cut = example:sub(1, 5) -- This cuts the string until the 5th letter 
print(cut) -- examp 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...