What a Backslash?
On Windows, the forward slash / indicates division, and is used for integer division; the backslash \ is used for directories.
- The backslash \ is used in Windows to indicate a directory.
- While in
- Problems with backslash \ and slash / shift character path in C #
- In C #, \ is an escape character, and only the next character is escaped. In some special cases, it needs to be used in pairs. Some specific uses of escape characters are as follows:
- For example, if you want to output this string "/ _ \", you might write @ "" / _ \ "" like this;
- However, writing the compiler will not allow it, but as shown in the table above, you can write "\" / _ \\\ "";
- In addition, many people like to use d: \ test.txt when getting the file path;
- Then the so-called escape character error will occur. The solution is that most people use @d: \ test.txt. I do nt know if it will cause some problems.
- But it has always been that d: /test.txt is also completely accessible
- I found it on the Internet. It seems that the biggest difference between a slash and a backslash is that the slash cannot be used to separate command line parameters in Windows, such as / to indicate options.
- The arithmetic operator / is used to take the quotient, such as 5/2 = 2.5.
- In VBA, \ means integer division. If the operand has a decimal part, the system will round it down and then calculate it. If the result has a decimal, it will also be rounded down. Such as 5 \ 2 = 2. 5 \ 5.25 = 1