Skip to content

Clarify escaping of backslash in String #64

@DainTrain

Description

@DainTrain

In section 9.2 Common Escape Sequences, an example is given of assigning the literal ¯\_(ツ)_/¯ to a String. The text says "you need to escape the first backslash." However, there is only one backslash in that literal, and the text misses out an on opportunity to clear up confusion as to the difference between forward slash and backslash.

Naturally this is low priority and somewhat pedantic, but I have noticed in my experience that even professional devs get backward and forward slashes mixed up, and therefore I think a brief note saying something to the effect of "the slash toward the end is a forward slash and does not need to be escaped because it is not a special character in a String" would help beginners

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions