I have a
"field" with string values like
What is the right expression for the QGIS Field calculator to get a 4-character string-field like
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
in Field calculator "lpad" does what you want:
Returns a string padded on the left to the specified width, using a fill character. If the target width is smaller than the string's length, the string is truncated.
so in your case it would be: