Did a fx() for you

Should be even much more faster.
Code:
stock extractstr(source[], char1, char2, result[128])
{
new
length = strlen(source),
i, // position of char1 in source
j; // position of char2 in source
// let's find char1 first ...
for (i = 0; i < length; i++)
if (source[i] == char1) break;
if (i < length) // is char1 part of source?
{
// let's find char2 afterwards ...
for (j = i + 1; j < length; j++)
if (source[j] == char2) break;
if (j < length) // is char2 part of source?
{
new result_length = j - i + 1;
if (result_length < 128) // is result long enough to hold the string?
{
// return the string and result length
copy(result, result_length, source[i]);
return result_length;
}
}
}
// return empty string and 0
result[0] = 0;
return 0;
}
Oh btw .. it's also returning a length of the result. Just for a case.
__________________