Newline problem in GUI.Box when text comes from database

I am having a string problem, that really doesn’t make any sense to me.

The following works as expected, including the newlines…

string Text="This is

a Test";
GUI.Box(new Rect(DialogWindow), Text, MySkin.box);

The above displays a box at the DialogWindow location with the following…

This is
a Test

Which is perfect.

Now, if instead of setting the string in code like that, I pull the exact same string from a SQLite database, it displays like…

This is

a Test

Debugging out both the string created in code, and the string pulled from the database, they appear to be identical.

I cannot figure out why, when using the string from the database, the newline character is displayed instead of a linefeed being inserted.

Anyone else ever see this problem? Any ideas how to get this to work as expected?

Any help is greatly appreciated.

-Larry

EDIT: As a test, I just copied the text from the SQLite table, and pasted it into the hard coded string, just to make sure they were truly identical. Same results. The hard coded string works, the string pulled from the database does not.

Here is an experiment for you to understand what’s happening here :

Create a script with that code, put it on any object.

var text : String;
function OnGUI(){
	GUI.Label( Rect( 10, 100, 500, 50 ), "First line

Second line" );
GUI.Label( Rect( 10, 200, 500, 50 ), text );
}

In the inspector, fill the variable text with : First line
Second line. Then run, and you’ll notice that the first label is ok, when the second one isn’t. I know more or less where that comes from, but you’ll need a pro for details. I think it’s about texte formatting done by the editor (monodevelop in my case) which isn’t done by unity editor, neither by your SQL apparently. To fix that, I suggest you split the sentence in your SQL into so many lines, then assemble it in your code like such :

str = line1fromSQL + "

" + line2fromSQL.

Just do this:

            string
                rumor_compilation;

            rumor_compilation = RumorTable[ rumor_index ].Replace( "\

", "
" );

            GUI.Box( new Rect( half_screen_width - 150, half_screen_height - 130 + 90 * rumor_index, 300, 90 ), rumor_compilation );

unity automatically adds an extra \ to the
in there