How do I type # in gdscript?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ca3games

I need to change a label to “C#” for some reason but godot simply doesn’t work because # is used for comments.

Does adding an escape character work? (“C\#”)

Akorian | 2018-05-25 07:03

:bust_in_silhouette: Reply From: ViktorEvil

maybe try ‘CSharp’ instead

:bust_in_silhouette: Reply From: Zylann

# is used for comments in code, you can’t use that letter there indeed.
But, putting it in a label’s text is definitely possible. Text is done using quotes, write "C#" for example:

my_label.text = "C#"

I don’t remember if # is allowed in node names, but if you are able to, get your node like this:

var my_node = get_node("Path/To/C#")