changing character on a string

fmhiguefmhigue Member Posts: 290
I got the following string (It can change)
|850206|94155|850206

I want to change it to <>850206&<>94155&<>850206. how can i do it?
I want to use that value to filter customer different that the string.

Thank you in advance

Comments

  • ara3nara3n Member Posts: 9,256
    write a function that would do the string manipulation.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • garakgarak Member Posts: 3,263
    a little function could look like this
    if (strlen(instr) > 0) then begin
      for i := 1 to strlen(instr) do begin
        if (Instr[i] = '|') then
          outstr += '&<>'
        else
          outstr += format(instr[i]);
      end;
      outstr := delchr(outstr,'<','&');
    end;
    

    you can also use the CONVERTSTR function, but there u must "puzzle" a little bit ..

    Regards
    Do you make it right, it works too!
  • AdministratorAdministrator Member, Moderator, Administrator Posts: 2,499
    [Topic closed because of Double Posting]
This discussion has been closed.