SphereCommunity
couple functions help - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: couple functions help (/Thread-couple-functions-help)



couple functions help - kn4tseb - 09-27-2014 12:20 PM

Hey guys, would you help me a bit?

lets say i have a string and inside it there are ARGVS that are repeated, how would i do it to compare all argvs and if one is repeated it will only keep one of them and remove the other..

I E:
ARGS = A,B,B,B,B,C,C,D,E,F,
RETURN = A,B,C,D,E,F


Thanks in advance


RE: couple functions help - Extreme - 09-27-2014 01:05 PM

I have no idea why do you want this, but:
PHP Code:
[FUNCTION WTF]
LOCAL.STR ","
FOR I 0 <EVAL <dARGV>-1>
 IF !
STRMATCH("*,<ARGV[<dLOCAL.I>]>,*","<LOCAL.STR>")
  
LOCAL.STR .= <ARGV[<dLOCAL.I>]>,
 ENDIF
ENDFOR
RETURN <
STRREVERSE <STREAT <STRREVERSE <STREAT <LOCAL.STR>>>>> 



RE: couple functions help - kn4tseb - 09-27-2014 01:13 PM

Interesting, thank you very much Extreme Wink