I really suck with strings so it’d be nice for some guidance. I want to be able to match strings in a PascalCase when only part of that string is provided. Lemme explain.
I’ve looked on the devforum and read the wikis but I couldn’t understand it, nor could I find useful answers.
Say I have a table with some strings in an array
local Test = {
'Pole',
'Sector',
'Division'
}
And for example I have some variables inside the workspace like so,
local NorthPole = workspace.NorthPole
local SouthPole = workspace.SouthPole
local EastPole = workspace.EastPole
local WestPole = workspace.WestPole
-- Same goes for the Sectors and Divisions, you get the gist of it
-- It also doesn't have to be in workspace, it can just be a variable somewhere
I want to match the string in the array, so that I’d get North, South, East, and WestPole from 1 string.
If I match the string ‘Pole’ I would get every single match and it returns every character in a PascalCase preceding it.
Any tips or some help?
To make clearer,
If I have string.match(Test[1], workspace:GetChildren) or something like that,
I want it to not only print ‘Pole’ but also North, South, East, and WestPole.
Sorry if the answer is really obvious, I am a dunce with strings.