Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
var i = x.IndexOf(y);
var i = x.indexOf(y);
defmodule Dry do
def indexOf(x, y, default \\ -1) do
case String.split(x, y, parts: 2) do
[head, _] -> String.length(head)
[_] -> default
end
end
end
I=index(x,y)
let i = x.indexOf(y);
int i = x.indexOf(y);
i = x:find(y)
$i = mb_strpos($x, $y, 0, 'UTF-8');
i := Pos(y, x);
$i = index($x, $y);
i = x.find(y)
i = x.index(y)
let i = x.find(y);