QString remove last characters

Sijith picture Sijith · Nov 9, 2017 · Viewed 27k times · Source

How to remove /Job from /home/admin/job0/Job

QString name = "/home/admin/job0/Job"

I want to remove last string after"/"

Answer

mekkanizer picture mekkanizer · Dec 20, 2017

You have QString::chop() for the case when you already know how many characters to remove.
It is same as QString::remove(), just works from the back of string.