Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: Search and replace in a string



Hi !

With PONX, you can do :

    if not PonxInit(oa,".RETURNSTRING.") then
        errorshow()
        return
    endif
    st0="AZERTY
    abcdef
    1234567890
    éèçàëäïù"
    str="str='"+PmRempl(st0,"\r\n","\r")+"'
    remplacerdanschainetxt(str,[('ZER','zer'),('abc','zzz')])"  ;<== List of
replace
    sret=oa.PRun(str)
    if sret<>"" then
        msginfo("Remplacement de 'ZER' par 'zer' & 'abc' par 'zzz'","  Avant
:\r\n"+st0+"\r\n\r\n  Après :\r\n"+sret)
    endif

You can do multiple search & replace ; you can also use regular expression ;
you can use memo ; etc.

See :  http://mclaveau.com/ress/ponx  at "Remplacement de texte dans un
string" and "Remplacement de texte dans un fichier texte"


@-salutations
--
Michel Claveau
site : http://mclaveau.com







<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.