Results 1 to 8 of 8

Thread: how to remove "\" symbol in url

  1. #1
    Join Date
    Nov 2014
    Location
    Chennai
    Posts
    160
    Thanks
    65
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default how to remove "\" symbol in url

    am having url inside tat url i want to remove special symbols like("\")
    i used str.remove("\" ");
    its not working..
    this was my url
    "http:\/\/103.3.229.181\/digital-photo-frame-ads\/public\/uploads\/07032015\/qzms7p5nfcza55539.jpg"
    can any one give me suggestion for this to remove "\" symbol
    Thanks in advance

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to remove "\" symbol in url

    In C++ backslash needs to be escaped by another backslash.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    iswaryasenthilkumar (6th March 2015)

  4. #3
    Join Date
    Nov 2014
    Location
    Chennai
    Posts
    160
    Thanks
    65
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to remove "\" symbol in url

    thank you i got answer by using this code
    str.remove(QRegExp(QString::fromUtf8("[-`~!@#$%^&*()_—+=|;<>«»,.?{}\'\"\\\[\\\]\\\\]")));
    Quote Originally Posted by wysota View Post
    In C++ backslash needs to be escaped by another backslash.
    Last edited by iswaryasenthilkumar; 6th March 2015 at 10:50.

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to remove "\" symbol in url

    I don't think removing that much is a good idea.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #5
    Join Date
    Nov 2014
    Location
    Chennai
    Posts
    160
    Thanks
    65
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to remove "\" symbol in url

    i got perfect url while using above code
    "http://103.3.229.181/digital-photo-frame-ads/public/uploads/07032015/qzms7p5nfcza55539.jpg"
    "http://103.3.229.181/digital-photo-frame-ads/public/uploads/07032015/srtsxvvopmu796070.png"
    "http://103.3.229.181/digital-photo-frame-ads/public/uploads/07032015/qlk7ajrnkh8z82910.png"
    i have doubt on this..using this link i want to download images can you give me suggestion for this???
    Thanks in Advance

  7. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to remove "\" symbol in url

    Quote Originally Posted by iswaryasenthilkumar View Post
    i got perfect url while using above code
    Great, what if the url is of the form: "http://my-example.com/~username/some_document%20with%20spaces?image_path=img@1&fmt =png"?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #7
    Join Date
    Nov 2014
    Location
    Chennai
    Posts
    160
    Thanks
    65
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to remove "\" symbol in url

    sorry wysota i dont have that much knowledeg to rectify what you asked
    Quote Originally Posted by wysota View Post
    Great, what if the url is of the form: "http://my-example.com/~username/some_document%20with%20spaces?image_path=img@1&fmt =png"?

  9. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to remove "\" symbol in url

    You don't have to rectify anything. Just use a JSON parser to parse your image list.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. The following user says thank you to wysota for this useful post:

    iswaryasenthilkumar (9th March 2015)

Similar Threads

  1. "Can't find linker symbol for virtual table" problem
    By Momergil in forum Qt Programming
    Replies: 0
    Last Post: 12th June 2014, 03:59
  2. Replies: 3
    Last Post: 22nd February 2011, 09:53
  3. Replies: 4
    Last Post: 5th January 2011, 16:51
  4. Replies: 3
    Last Post: 17th November 2008, 09:48
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.