Snippets tagged “string-literals”
3 snippets use this tag.
- Using Enum values as String literalsJava
To use the values of an enum as string literals in Java, you can use the name() method of the Enum class. This method returns the name of the enum value as a string.
- What are all the escape characters?Java
In Java, an escape character is a character that is preceded by a backslash (\) and is used to represent special characters or character sequences.
- What exactly do "u" and "r" string prefixes do, and what are raw string literals?Python
In Python, the "r" prefix before a string denotes that it is a raw string literal.