Page 1 of 1

FoldString_

Posted: Wed Aug 25, 2021 12:03 pm
by loulou2522
Hi all
Does the api function FoldString_(#MAP_COMPOSITE ,car,1,result,1 ) which allow to transform an é in e or an ù to u exists in Spiderbasic
Thanks

Re: FoldString_

Posted: Wed Aug 25, 2021 12:22 pm
by Peter
In SpiderBasic there are no API commands.

Code: Select all

Procedure.s FoldString_(str.s)
  ; https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript
  ! return v_str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
EndProcedure

Debug FoldString_("Crème Brulée")

Re: FoldString_

Posted: Wed Aug 25, 2021 12:38 pm
by loulou2522
THanks Peter