#How to get the initials of a text variable
1 messages · Page 1 of 1 (latest)
?render
#let home-place = "Federal University of Ceará"
#let words = home-place.split()
#let letters = words.map(word => word.at(0))
#letters.join()
#let capletters = letters.filter(l => upper(l) == l)
#capletters.join()
I suggest to get a look of methods of arrays and strings in Typst Reference. There are lots of useful methods you can combine like this.
Thank you! I actually did it. My solution was
#home_place.split().map(word => word.find(regex("[A-Z]"))).join()
But I had the impression that my solutions wasn't great...