Getting the beginning and the end of a string

I want to get the first 2 numbers and the last 2 numbers of an User ID, how could I do that? A function? Im not sure how to do it…

I need a link, thread, API, an example… anything like that to help me :slight_smile:

Why do you need to do that? I’m just wondering because there may be an easier way.

Code:

local firstTwoCharacters = string.sub(player.UserId, 1, 2)
local lastTwoCharacters = string.sub(player.UserId, -2, -1)
1 Like

Just wanting to make a thing for my game… Nothing that will really impact gameplay, its just a detail that I’ll put on a TextLabel…

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.