Quote:
Originally Posted by Depresie
I was also thinking about strings
A native to retrieve how many times a string contains a character
Adding a param to return on what cells it is present would also be nice
PHP Code:
// Prototype stroc(const string[], "c")
//Functionality new iNumO = stroc("cool shirt", "o") // iNumO would be equal to 2 in this case
|
May I ask you, what is the reason for this to get implemented? Because you can simply use something like this:
PHP Code:
new data[6], _dummy, count
menu_item_getinfo(menu, item, _dummy, data, charsmax(data), .callback = _dummy)
for(new i; i<charsmax(data); i++)
if(data[i] == 'o')
count++
Idk if you were trying to make a joke or what, but it is random and useless. And yes, maybe you want to use that function because this would be faster in a module, but in that case, I would like to get this: included into next update.
PHP Code:
stock Array_Find(item, array[], size) {
for(new i; i<size; i++)
if(array[i] == item)
return i
return -1
}
because I use this in one of my plugins. anyways, no offence, just giving my thoughts on that one. And I support the page numeration idea.
__________________