Replaces '\' characters with '/'.
(String path)
| 203 | |
| 204 | /** Replaces '\' characters with '/'. */ |
| 205 | public static String fixPath (String path) { |
| 206 | if (path==null) |
| 207 | path = ""; |
| 208 | if (!IJ.isWindows()) |
| 209 | return path; |
| 210 | StringBuilder sb = new StringBuilder(); |
| 211 | for (int i=0; i<path.length(); i++) { |
| 212 | char c=path.charAt(i); |
| 213 | if (c=='\\') |
| 214 | sb.append("/"); |
| 215 | else |
| 216 | sb.append(c); |
| 217 | } |
| 218 | return new String(sb); |
| 219 | } |
| 220 | |
| 221 | /** Replaces special characters in a String for creation of a quoted macro String. Does not add quotes. */ |
| 222 | public static String fixString (String str) { |
no test coverage detected