Help with Running Through a String using a Value

I would like to know how do you get like the first or any point of a string like for example:

local string = 'cool world'
local value = '4'

--[[ confusing code here ]]
--it should return the fourth letter of the string.

I’d try looking into a function that all strings can use, called sub: string | Documentation - Roblox Creator Hub
It works like this:

local stringValue = 'cool world'
local value = '4'

print(string.sub(stringValue, value, value))
2 Likes

Thank you so much :fire:
It works!1!

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