Contains text

From Kolmafia
Revision as of 14:23, 10 March 2010 by imported>Grotfang (Create page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Syntax

boolean contains_text(string str ,string substring )

  • str is the string you want to test.
  • substring is the substring you want to check is present inside str.

Returns true if substring can be found within str.

Code Samples

This function tests to see whether the string "Hello World!" contains the word "World".

boolean string_check(){
   if(contains_text("Hello World!" , "World")){
      return true;
   }
   return false;
}