fork download
  1. function stripos (palheiro, agulha)
  2. palheiro = string.lower(palheiro)
  3. agulha = string.lower(agulha)
  4.  
  5. if palheiro ~= nil and agulha ~= nil then
  6. return (string.find(palheiro, agulha) -1)
  7. else
  8. return nil
  9. end
  10. end
  11.  
  12. print(stripos("I love php, I love php too!", "PHP"))
Success #stdin #stdout 0s 2832KB
stdin
Standard input is empty
stdout
7