Add an escape to String.format() #9190
luckyabsoluter
started this conversation in
Scripting
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There is no escape for printing
{}
inString.format()
.You cannot print
{hi} is bye
.In Python,
{{
and}}
are escaped inf"}}format{{"
.However, GDScript is being used in a different way because of that.
#5391
But you can use
"{{{gender}}}"
instead of"{{gender}}"
.Also, you can use
"{{{{{{{gender}}}}}}}"
instead of"{{{gender}}}"
.Since
String.c_unescape()
does not support\u
, the following is also not possible.godotengine/godot#38716
Currently, you can use the following:
Since this does not seem like the normal way, a new method should be introduced.
Beta Was this translation helpful? Give feedback.
All reactions