I would like to select cities in my attribute table according to their suffix. For example: select only cities which end with "ton". How can I do this?

New contributor
iMichMich is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Use select by expression with this expression:

if (right ("city", 3) = 'ton', true, false)

where city is the fieldname of the string (input) that you want to search - replace it with the name of your field.

Output of the expression is true if the suffix is ton, otherwise it is false - combined with select by expression it will create a selection of cases that end in -ton.


Simply you can use Like function in Select by expression. Assuming the field name of cities is "CityName" it will be like this:

"CityName" LIKE '%ton'

In the following example, the field name of city names is Name. Applying the above expression

"NAME" LIKE '%ton'

I got the following result:

enter image description here

Your Answer

iMichMich is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.