ArrayFindString Issue
Hey There!
I just realized ArrayFindString will returns the index of the first occurence of the specified string. As it says in the documentation. If you have an array like: - de_dust2_long - de_nuke And you are looking for a string like: - de_dust2 The function will returns 0 instead of -1. I know de_dust2 is part of de_dust2_long, but wouldn't be nice a 3rd param of the original function to search exact string or substing? PHP Code:
|
Re: ArrayFindString Issue
This has been reported here but in the context of this being a bug of the original function. I personally agree with this being a bug for this function as opposed to a feature request to be added.
|
Re: ArrayFindString Issue
Check this out, it does the same thing but it compares every item from array.
https://forums.alliedmods.net/showth...=329651&page=2 |
Re: ArrayFindString Issue
Quote:
At this point, the functionality can not be changed(to keep backwards compatibility), but a new argument shoule be added to control how the string is matched. |
Re: ArrayFindString Issue
Quote:
|
Re: ArrayFindString Issue
And should include another argument for case sensitiveness. In its current state, there is no real use, you'd better just write a stock for searching strings.
|
| All times are GMT -4. The time now is 11:30. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.