uriLength

Does string s[] start with a URL?

ptrdiff_t
uriLength
(
Char
)
(
scope const(Char)[] s
)
if ()

Return Value

Type: ptrdiff_t

-1 it does not len it does, and s[0 .. len] is the slice of s[] that is that URL

Examples

string s1 = "http://www.digitalmars.com/~fred/fredsRX.html#foo end!";
assert(uriLength(s1) == 49);
string s2 = "no uri here";
assert(uriLength(s2) == -1);
assert(uriLength("issue 14924") < 0);

Meta