Ersetzen Ende von string mit Punkten, wenn Wort länger ist, dann ist X

Wie kann ich den format string in einem Razor CSHTML-Seite, wenn es länger ist, dann ist X Woerter:

<p>@Model.Council</p> 

Example for an X = 9

-> if Council is "Lisbon", then the result is "<p>Lisbon</p>"
-> if Council is "Vila Real de Santo António", then the result is "<p>Vila Real...</p>" with the title over the <p> "Vila Real de Santo António" showing the complete information

Dank.

InformationsquelleAutor Patrick | 2013-05-27
Schreibe einen Kommentar