Thursday, July 28, 2016

back slash *\* or forward slash */*



[windows/dos command]

[abstract]
in that the DOS commands only accept back slash '\' in a path string,
so before commands executed, the path string should be disposed.


[]
to replace '\\' to '/'
     
     #include <algorithm>
     std::string backslashPath = "D:\\imDirectory\\imFile.ext";
     std::replace(backslashPath.begin(), backslashPath.end, '\\','/');

to replace '/' with '\\'

     #include <algorithm>
     std::string forwardslashPath = "D:/imDirectory/imFile.ext";
     std::replace(forwardslashPath.begin(), forwardslashPath.end(), '/','\\');


Done :-)
End :-)
__________

No comments:

Post a Comment