Page 1 of 1

Find a 12 letter word in a string.

Posted: Fri Aug 22, 2014 8:00 pm
by MxMCube
This is some code.

Code: Select all

amazingString = "Hello, this is a test. Blahblahblahblahblah"
I need an if statement that can find a 12 letter word inside amazingString, and if it does find a 12 letter word, then do something.

Re: Find a 12 letter word in a string.

Posted: Fri Aug 22, 2014 9:30 pm
by Zeliarden

Code: Select all

if string.find(amazingString, string.rep("%a", 12)) then
	--something
end