AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   performing case insensitive string compairs?... (https://forums.alliedmods.net/showthread.php?t=3252)

ThantiK 07-01-2004 10:13

performing case insensitive string compairs?...
 
Is there such a way to go about doing this in small?

Dygear 07-01-2004 12:32

:D, This would be better in Scripting Help.
Mod ... Move this please.

ThantiK 07-01-2004 13:49

Crud, I didn't even notice that I posted in wrong forum...=/

BAILOPAN 07-01-2004 13:57

Just make them both lowercase and then compare them

ThantiK 07-01-2004 14:05

is there an "lcase" function to turn it all lower case?

I'd like to do something like
get_user_name (un)
un = lcase(un)

Ryan 07-01-2004 19:41

Quote:

Originally Posted by string.inc
/* Checks if two strings equal with case ignoring.
* If len var is set then there are only c chars comapred. */
native equali(const a[],const b[],c=0);

yes there is.

BAILOPAN 07-01-2004 20:14

equali() isn't the same as strcmpi(), which is real string comparison

ThantiK 07-01-2004 20:21

which and how can you convert it to all lower case?...

This would be a great addition to amx if possible. For string compairs.

Say I want to auto-kick all myg0t...

anyone w/ Myg0t would get by, mYg0T, mYg0t, MYG0T would also get by...thats my problem.

Ryan 07-01-2004 21:58

Quote:

Originally Posted by BAILOPAN
equali() isn't the same as strcmpi(), which is real string comparison

what's the difference between the two?

Downtown1 07-01-2004 22:06

Well, equali() returns true or false, and strcmpi() returns 0 if the two strings are the same, < 0 if the first string is less than the second string, and > 0 if the first string is greater than the second string.
(actual return values may vary by implementations, and I can't tell you what AMXX would've had since it simply doesn't have strcmpi()).


All times are GMT -4. The time now is 14:56.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.