I want to abbreviate a string with Thymeleaf

后端 未结 1 778
刺人心
刺人心 2021-01-27 09:26

I have a table and I want to change a column, the column contains a string. For example: \"this is my string\" --> \"this is my...\". I try to do this whith abbreviate().

相关标签:
1条回答
  • 2021-01-27 10:09

    Your syntax needs to be corrected.

    The general case is: ${#strings.abbreviate(str,10)} so you would want:

    <td th:text="${#strings.abbreviate(fgp.explanation, 10)}">[this is my...]</td>

    0 讨论(0)
提交回复
热议问题