Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
String Searcher
--String Searcher by T()m local searchString = "Lua-5.3" --//What to search local searchFor = "Lua" --//What to find in searchString local caseSensitive = true --//If false, uses string.lower to have non-"case sensitive" local stringLength = string.len(searchString) local startSub = 1 local found = false local endSub = string.len(searchFor) print("Length: "..stringLength) if not caseSensitive then searchString = string.lower(searchString) searchFor = string.lower(searchFor) end for search = 1, stringLength do if string.sub(searchString, startSub, endSub) == searchFor then found = true else startSub = startSub + 1 endSub = endSub + 1 end end if found then print("Found "..searchFor.." in "..searchString.." @ sub("..startSub..", "..endSub..")") else print("Could not find "..searchFor.." in "..searchString) end
run
|
edit
|
history
|
help
0
Brainfuck Interpreter (Lua) [reposted]
gdgdf
Surface Area of things (Incomplete)
test123
Dirty Bag 'o Tokens Maker
Newton-Raphson method for the square root
test3
Creating habits. Lua
l
Hand positions in a circle