Maximum length of text in a GUILayout.Label?

I am trying to display a large amount of text in a scrollable area, but there seems to be a limit on how much a GUILayout.Label can show - not all of the string that I pass to it is shown. Is there a maximum length to the text that can be displayed? Can I increase it or is there some other way to show more text in a scrollview?

Here’s my code:

    GUIStyle g = new GUIStyle ();
    g.normal.background = bkg;	
    scrollPosition = GUILayout.BeginScrollView (scrollPosition,g, GUILayout.Width (770), GUILayout.Height (300));
    
    g = new GUIStyle();
    g.normal.textColor = new Color(255,0,0);
    		
    GUILayout.Label (staticScript.log,g, GUILayout.ExpandHeight (true), GUILayout.MaxHeight(float.MaxValue), GUILayout.ExpandWidth(false),GUILayout.Width (730));
    GUILayout.EndScrollView ();

When I set a breakpoint and check the value of staticScript.log, I see the whole text, but only a part is displayed.

I had same issue I created a hack using string.split and drawing labels for each line

var stringValue = SomeStringValue.Split(new[] { "

" }, StringSplitOptions.None);
foreach (var value in stringValue)
{
GUILayout.Label(value);
}

This also gives you the ability to optimize the draw and layout count if you use this technique in combination with a scroll view where you only draw labels that would be in current scroll view instead of drawing the entire array of lines.