- Home /
[Meta] How do you escape < and > characters ?
Hey !
How do you usually write generic code in Unity Answers ? I'm trying to write something like GetComponent< ComponentType >()
without the spaces but all I get is GetComponent()
.
Is there a way to escape those characters so that their content isn't mistaken for a markup ?
Thank you !
You can use the 101010 button, or indent four spaces in front of the line or use
> and <
Looking up the $$anonymous$$arkup syntax I found > and <
too, but they don't seem to work like this.
Answer by Clet_ · May 21, 2014 at 03:59 AM
Type those in a code block (THe 101010 icon above an answer).
GetComponent<MyComponent> ();
Thanks ! I wish there was a way to do it without creating a code block (like above), but it guess it make sense since such generic code is likely to be found inside pieces of code.
Your answer
![](https://koobas.hobune.stream/wayback/20220613145525im_/https://answers.unity.com/themes/thub/images/avi.jpg)