Jump to content

[HELP] string.find


xXGhostXx

Recommended Posts

Posted

Hi guys.

I try to use string.find with table.

characters = {
	["a"] = true, ["b"] = true, ["c"] = true,
}

function test (username)
	if string.find(username, characters[username]) then
    else
    	outputChatBox("This is invalid character!",source)
    end
end

What is my problem ?

Posted

Here you go:

characters = {"a", "b", "c"}

function test(username)
    if string.find(username, "["..table.concat(characters, "").."]") then
        
    end
end

 

Posted (edited)
1 hour ago, xiRocKyz said:

Here you go:


characters = {"a", "b", "c"}

function test(username)
    if string.find(username, "["..table.concat(characters, "").."]") then
        
    end
end

 

Working because i want add allowing characters in table.

Edited by xXGhostXx
  • Moderators
Posted
5 minutes ago, xXGhostXx said:

help!

Even after you received my warning, you are still continuing with bumping 2x. The content of those messages are not useful in anyway and very annoying for everybody, therefore I consider them as spam.

Locked

  • IIYAMA locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...