StringReplace on all occurrences

0

I would like to replace all \ with / in my edit, but it only works for the first occurrence with the following code:

Edit1.text := '"'+ StringReplace(Edit1.text, '\', '/', []) + '"';

How do I replace all of them?

Enjoying, the result would look something like

"C:/Users/Usuario/Documents/BD Demo/Alta Cruz/AltaCruz_c/"

How to remove the last / after the AltaCruz_c?

    
asked by anonymous 18.03.2016 / 20:15

1 answer

2

You should pass the rfReplaceAll flag as it appears in documentation

StringReplace (Edit1.text, '\', '/', [rfReplaceAll]);

    
18.03.2016 / 20:35