QGIS Labeling – How to Label with Only the First Letter of String in QGIS

labelingqgisstring

I have a field called "Genus" where there are string values, for example, the word 'Pinus'.

I want my label to show only the first letter of this word so in my example 'P'.

I was trying to use Function Editor. I was contriving with field.row[0], but I'm not sure with the rest of the syntax.

Maybe there is another solution for it?

Best Answer

Use this in your label composer, it should do the trick :

left("Genus", 1)

Here's a list of functions you can use in your expressions