"Hello World".find("World") /* Returns 6 */
+### <a id="string-contains"></a> String#contains
+
+Signature:
+
+ function contains(str);
+
+Returns `true` if the string `str` was found in the string. If the string
+was not found `false` is returned. Use [find](20-library-reference.md#string-find)
+for getting the index instead.
+
+Example:
+
+ "Hello World".contains("World") /* Returns true */
+
### <a id="string-len"></a> String#len
Signature
return result;
}
+static bool StringContains(const Value& value)
+{
+ ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
+ String self = vframe->Self;
+ return self.Contains(value);
+}
+
static Value StringReplace(const String& search, const String& replacement)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
prototype->Set("lower", new Function(WrapFunction(StringLower)));
prototype->Set("split", new Function(WrapFunction(StringSplit)));
prototype->Set("find", new Function(WrapFunction(StringFind)));
+ prototype->Set("contains", new Function(WrapFunction(StringContains)));
prototype->Set("replace", new Function(WrapFunction(StringReplace)));
}