Raised This Month: $51 Target: $400
 12% 

How to check if A is substring of B?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
m4x
Junior Member
Join Date: Sep 2008
Old 10-03-2008 , 03:39   How to check if A is substring of B?
Reply With Quote #1

Sorry,

never done a script in this. Actualy, I need to read parameters for a function and because it is for public use, it should be flexible for variants (switching languages for teamspeak).
Like anything of "FR, fr, Fr, fra, fre, french, francais" means the same.

I would like to check, if argument used by players matches as a substring with my language strings.

decl String:ch_arg1[256];
decl String:ch_arg2[256];
ch_arg1 = "FR, fr, Fr, fra, fre, french, francais"
ch_arg2 = "DE, de, De, Ger, deu, Deutsch, german"

decl String:kanal[64];
GetCmdArg(1, kanal, sizeof(kanal));

and then something like (IN is used in eventscripts for this)

if (kanal IN ch_arg1) { .....
if (kanal IN ch_arg2) { .....


-------
Is this what I need?

Syntax: native bool:GetRegexSubString(Handle:regex, str_id, String:buffer[], maxlen);

If yes, how to use it for my problem?

THX a lot
m4x
m4x is offline
 



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 06:35.


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