Hello roblox forum,
I want to achieve a function that checks if cursor position of a textbox is on word index
like that
local function check(textbox, index)
return textbox.SelectedWord == index
end
--or like this (| means cursor)
--i want to check if cursor is located on first word or not
"WordO|ne WordTwo"
I am familliar with this
local selectedText = string.sub(
textBox.Text,
math.min(textBox.CursorPosition, textBox.SelectionStart),
math.max(textBox.CursorPosition, textBox.SelectionStart)
)
but there is no “selectedWord” method