[SOLVED] string endsWith in QML for url detection
-
i have tried to take a string like var urlString = http://rss.cbc.ca/lineup/canada.xml
how am i able to see if the urlString endsWith ".xml"
-
This should do: http://qt-project.org/doc/qt-4.8/qstring.html#endsWith
-
Actually, forget what I just said :-) Sorry. I think from within JS, you need to use regular expressions:
@
var endsWithXml = /xml$/;
if (endsWithXml.test(<filename>)) { ...}
@ -
Thanks I'll try that
-
Well i gave that a try and works perfect
thanks for your help