- Home /
Unity's Equivalent of Console.Write();
Does Unity have a equivalent to Console.Write()?
I don't mean Console.WriteLine, since I could just use Debug.Log() or print(); Console.Write() does not use a line break whenever printing to the console, used specifically for printing arrays without making a new line.
Is this possible in Unity?
Answer by Thom Denick · Dec 28, 2014 at 06:44 AM
There isn't simply because of how Unity's Console works. You can use Console.WriteLine (and any other C# function) but Unity's Console doesn't treat it as you like.
Generally, what I do when I want to debug out a lengthy multi-line output is to construct the string dynamically, then just Debug.Log out the constructed string. You won't see all of the text in the console window unless you click on it, then you can see it on the detail view below.
If I were to have a Char Array (Char[]) In which every element has a single letter for a sentence, how would I turn the whole array into a sentence/string?
http://www.dotnetperls.com/convert-char-array-string Just change the Console.WriteLine() to Debug.Log()