The original path string with only single backslashes.
The passed path but doubly backslashed.
string path = r"c:\Windows\system32"; assert(path.doublyBackslashed == r"c:\\Windows\\system32");
{ enum path = r"c:\windows\system32"; enum expected = r"c:\\windows\\system32"; immutable actual = path.doublyBackslashed; assert((actual == expected), actual); } { enum path = r"c:\Users\blerp\AppData\Local\kameloso\server\irc.chat.twitch.tv"; enum expected = r"c:\\Users\\blerp\\AppData\\Local\\kameloso\\server\\irc.chat.twitch.tv"; immutable actual = path.doublyBackslashed; assert((actual == expected), actual); } { enum path = r"c:\\windows\\system32"; enum expected = r"c:\\windows\\system32"; immutable actual = path.doublyBackslashed; assert((actual == expected), actual); }
Returns the supplied string with any backslashes doubled. This is to make paths on Windows display properly.
Merely returns the given string on Posix and other non-Windows platforms.