[Solved] Stripping double quotes from string
Hi,
If I try to call toString() method on any object in QML, it’s string representation is always enclosed in escaped double quotes. For e.g.
calling toString() on a url object gave me:
\“http://en.wikipedia.org/wiki/India_(disambiguation)\”
Why is it like this ? Does QML have any function to strip these surrounding escaped double quotes ? Actually I was doing some string processing using Javascript and having these double quotes is strange.
2 replies
Could you paste an example showing the problem?
The following seems to output the correct string and length for me (doesn’t include the escaped double quotes)
- import QtQuick 1.0
- Rectangle {
- width: 400; height: 400
- property url myProp: "index.qml"
- Component.onCompleted: console.log(myProp + " " + myProp.toString().length)
- }
Does it work correctly for you?
Regards,
Michael
You must log in to post a reply. Not a member yet? Register here!


