title: Trailing hyphen in Android TextView
body: <p>I'm experiencing an issue when limiting number (setting <code>maxLines </code>) of rows and space in an Android TextView with hyphenation (<code>hyphenationFrequency=&quot;full&quot;</code>). For example, trying to display the following string <code>Long\u00adstring\u00adfoobar</code>, which contains soft hyphens (<code>\u00ad</code>), in a TextView where the string doesn't fit, yields the following result:</p>
  <p>Long-<br>
  string...-</p>
  <p>Is there any way to not get the trailing hyphen in this case? Is it a Android issue or am I doing something wrong?</p>
  <p>Layout code:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout
          xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
          xmlns:tools=&quot;http://schemas.android.com/tools&quot;
          xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          tools:context=&quot;example.MainActivity&quot;&gt;
  
      &lt;TextView
              app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
              app:layout_constraintRight_toRightOf=&quot;parent&quot;
              app:layout_constraintTop_toTopOf=&quot;parent&quot;
              app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:id=&quot;@+id/tv&quot;
  
              android:hyphenationFrequency=&quot;full&quot;
              android:layout_width=&quot;50dp&quot;
              android:ellipsize=&quot;end&quot;
              android:maxLines=&quot;2&quot;
              android:text=&quot;Long\u00adstring\u00adfoobar&quot;
  
              /&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/DKWSM.png" rel="nofollow noreferrer">Screenshot of result</a></p>