Re: Unicode Control characters
> Le 5 nov. 2014 à 15:25, Chip Scheide <4dOnly@xxx.xxx> a écrit :
>
> for example do I need to "wrap" '=' for text?
> something like:
>
> mytextisEqual(Text1;Text2)
Hi Chip,
I use this:
+++
//Strequal (str1;str2) -> bool
//strict comparison
CBOOLEAN($0)
CTEXT($1)
CTEXT($2)
CBOOLEAN($outb)
If (False)
CBOOLEAN(Strequal ;$0)
CTEXT(Strequal ;$1)
CTEXT(Strequal ;$2)
End if
//
$outb:=False //pessimistic
Case of
: (Not(Asserted(Count parameters>1;Current method name+" 2 params expected")))
: (Length($1)#Length($2))
: (Length($1)=0)
$outb:=True //both are empty
Else
$outb:=(Position($1;$2;1;*)=1)
End case
$0:=$outb
//
+++
One could use regex too, but since the * parameter added in v11, Position is faster (and simpler!)
--
Arnaud de Montard
**********************************************************************
See how easy it is to extend your 4D solutions to Web and mobile. New opportunities await you with 4D v14!
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-Unsubscribe@xxx.xxx
**********************************************************************