I have a string like so “123456789012345678901234” its always going to be 24 characters and always numbers, I’m wondering how I can insert the “-” character at every 4 characters excluding the last so I get “1234-5678-9012-3456-7890-1234”?
I have a string like so 123456789012345678901234 its always going to be 24 characters
Share
Like this:
("123456789012345678901234"):gsub(("(%d%d%d%d)"):rep(6), "%1-%2-%3-%4-%5-%6")?