Programming-Idioms

New implementation

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
with Ada.Strings.Fixed;
use Ada.Strings.Fixed;
Ok : Boolean := Index (S, Word) > 0;
#include <string.h>
int ok=strstr(s,word)!=NULL;
(require '[clojure.string :as string])
(def ok (string/includes? word s))
#include <string>
ok = s.find(word) != std::string::npos;
var ok = s.Contains(word);
import std.algorithm.searching;
bool ok = s.canFind(word);
var ok = s.contains(word);
ok = String.contains?(s, word)
Ok = string:str(S, Word) > 0.
ok = index(string, word) /= 0
import "strings"
ok := strings.Contains(s, word)
ok = word `isInfixOf` s
var ok = s.includes(word);
var ok = s.indexOf(word) !== -1;
boolean ok = s.contains(word);
val ok = s.contains(word)
ok = s:find(word, 1, true)
ok = s:find(word, 1, true) ~= nil
ok = false
if s:find(word, 1, true) then ok = true end
$ok = strpos($s, $word) !== false;
ok := pos(word,s)<>0;
$ok = index($s,$word) >= 0;
ok = word in s
ok = s.include?(word)
let ok = s.contains(word);
val ok = s.contains(word)
Dim ok As Boolean = s.Contains(word)