Can I use QRegExp to remove the extension of a file?
Hi mates!
Given a QString (c:\blabla\text.ico) I'd like to remove its extension (c:\blabla\text).
That's pretty easy scaning the string till the dot and splitting it.
My question is, is it possible to use QRegExp to do that?
I ask this cause I read in docs that:
"String Splitting: A regexp can be used to identify where a string should be split apart, e.g. splitting tab-delimited strings."
But no idea about how to do it.
Any idea?
Thanks for your help.
Re: Can I use QRegExp to remove the extension of a file?
I won't tell you how you can use a reg exp for that, because it is too heavy for a simple operation like that. Better use QString::lastIndexOf() with QString::chop().
Re: Can I use QRegExp to remove the extension of a file?
Re: Can I use QRegExp to remove the extension of a file?
Very usefull, thanks a lot! I will use them instead a regular expresion.