Results 1 to 4 of 4

Thread: How to check if a string starts with a substring?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to check if a string starts with a substring?

    Hi,

    Sorry I have another question, how to check in pro file if a string starts with a substring?

    For instance, I have

    string1 = /foo/bar/blah/etc
    string2 = /foo/bar

    What function can I use to check if string1 starts with string2 or not?

    Many thanks.
    lni
    Last edited by lni; 17th April 2007 at 22:24.

Similar Threads

  1. Reading from sockets in a multithreaded program
    By KoosKoets in forum Qt Programming
    Replies: 9
    Last Post: 4th April 2007, 20:43
  2. saving a c string of variable length in a shared memory?
    By nass in forum General Programming
    Replies: 4
    Last Post: 3rd January 2007, 14:40

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.