Raised This Month: $ Target: $400
 0% 

performing case insensitive string compairs?...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 07-01-2004 , 10:13   performing case insensitive string compairs?...
Reply With Quote #1

Is there such a way to go about doing this in small?
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
Dygear
SourceMod Donor
Join Date: Apr 2004
Location: Levittown, NY
Old 07-01-2004 , 12:32  
Reply With Quote #2

, This would be better in Scripting Help.
Mod ... Move this please.
Dygear is offline
Send a message via AIM to Dygear Send a message via MSN to Dygear Send a message via Skype™ to Dygear
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 07-01-2004 , 13:49  
Reply With Quote #3

Crud, I didn't even notice that I posted in wrong forum...=/
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
BAILOPAN
Join Date: Jan 2004
Old 07-01-2004 , 13:57  
Reply With Quote #4

Just make them both lowercase and then compare them
__________________
egg
BAILOPAN is offline
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 07-01-2004 , 14:05  
Reply With Quote #5

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)
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
Ryan
Senior Member
Join Date: May 2004
Location: NH, USA
Old 07-01-2004 , 19:41  
Reply With Quote #6

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.
__________________
Warcraft 3: Expansion
Homepage | Downloads | Forums
Ryan is offline
Send a message via AIM to Ryan
BAILOPAN
Join Date: Jan 2004
Old 07-01-2004 , 20:14  
Reply With Quote #7

equali() isn't the same as strcmpi(), which is real string comparison
__________________
egg
BAILOPAN is offline
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 07-01-2004 , 20:21  
Reply With Quote #8

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.
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
Ryan
Senior Member
Join Date: May 2004
Location: NH, USA
Old 07-01-2004 , 21:58  
Reply With Quote #9

Quote:
Originally Posted by BAILOPAN
equali() isn't the same as strcmpi(), which is real string comparison
what's the difference between the two?
__________________
Warcraft 3: Expansion
Homepage | Downloads | Forums
Ryan is offline
Send a message via AIM to Ryan
Downtown1
Veteran Member
Join Date: Mar 2004
Old 07-01-2004 , 22:06  
Reply With Quote #10

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()).
Downtown1 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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