From: Petr M. <mi...@ph...> - 2010-07-19 13:40:18
|
> is there a built-in string replacing function? > a = replace("ABC\\XYZ", "\\", "/") # a -> "ABC/XYZ" you can use the following: # replace "o" by "XYZ": a="hello world" b="echo ".a." | sed s=o=XYZ=g" c=system(b) print c => it prints: hellXYZ wXYZrld > It would be very useful especially when migrating between Linux and Win apps > as Linux uses "/" as directory separator but Windows use "\". This is not needed if gnuplot is compiled by a gcc-based suite on Windows; thus use always "/". --- Petr Mikulik |