Find a 12 letter word in a string.

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
MxMCube
Prole
Posts: 8
Joined: Thu Aug 21, 2014 11:56 pm

Find a 12 letter word in a string.

Post 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.
Zeliarden
Party member
Posts: 139
Joined: Tue Feb 28, 2012 4:40 pm

Re: Find a 12 letter word in a string.

Post by Zeliarden »

Code: Select all

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

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 3 guests