title: How to get the number of lines displayed in a Textmeshpro - text (UI)?
body: <p>So in my script I want to know how many lines are displayed in a Textmeshpro - text (UI).</p>
  <pre><code>public TextMeshProUGUI commentaryText;
  
  Debug.Log(&quot;number of lines &quot; + (commentaryText.text.Split('\n').Length - 1));
  </code></pre>
  <p>I tried something like above but it will only show the number of lines with a \n newline character, however I also want to know about lines that are caused by wraparound when they reach the limit of the textbox. Is there a way to get the number of lines that the user sees?</p>
  <p>Any advice appreciated. Thanks</p>
  <p><a href="https://i.stack.imgur.com/Q5OLh.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q5OLh.jpg" alt="enter image description here" /></a></p>