Backslash is the escape character, so just  '\' would be an unterminated string. \\ represents a single \, so it behaves as intended :)