I have a $string that I need to shorten. {{ $string | first 42 }} works reasonably well, as long as the strings is ASCII, which is rarely the case for me, so I usually end up with $string cut half-rune and looking ugly.
Is there a way Iโm missing to get first N runes of a string?
That ends with a smile for me. Wonderful when things just work the way they should.
While this is a guess, many modern programming languages donโt equate strings to arrays precisely for the reason youโre seeing. first is a command for arrays, probably safer to use the ones meant for strings.