×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jan 2009
    Location
    ભારત->ગુજરાત->ભાવનગર
    Posts
    279

    Question string manipulation

    hi
    here is one string "watch?v=LNORVlUlcnY"
    i have used indexof("v=") to get the first appearance of my string...i have got the location .....now my question comes here it that ...i want to get the rest part of string that is "LNORVlUlcnY"....from my location....
    is their any string function to perform this operation ??
    Regards
    Viral Parmar

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: string manipulation

    You can use QString::split(), then address will be second element in QStringList
    http://doc.trolltech.com/4.6/qstring.html#split

  3. #3
    Registered User
    Join Date
    Jan 2009
    Location
    ભારત->ગુજરાત->ભાવનગર
    Posts
    279

    Question Re: string manipulation

    hi divanov
    what actually i want is that ...how to get the rest part of the string from the integer value return from the indexof() function..

    For example :From this given code below..

    string str="watch?v=LNORVlUlcnY";

    int i =str.indexof("v=");

    I want something like...
    stirng str1 = str.substring(str.indexof("v="),str.length);

    suppose i will get the location i=1506...now from this location i want to move ahead to capture the "LNORVlUlcnY" this string...and i think split() function will split the string into two substring.
    i want to get the string from my location "i".
    Last edited by mind_freak; 2010-04-11 at 11:54.
    Regards
    Viral Parmar

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: string manipulation

    Do you need this i for anything?

  5. #5
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: string manipulation

    Are you looking at the QString reference doc? http://doc.qt.nokia.com/4.6-snapshot/qstring.html

    There are several functions that can do what you want. The simplest is probably "mid()", the Qt equivalent of Java's substring function. But there are also, "right()", and, maybe ideal for your situation, "section()", which even eliminates the need for the separate indexof().

  6. #6
    Registered User
    Join Date
    Jan 2009
    Location
    ભારત->ગુજરાત->ભાવનગર
    Posts
    279

    Smile Re: string manipulation

    hey danhicksbyron

    thanks a lot ,i have used mid() an ....its working...
    Regards
    Viral Parmar

Similar Threads

  1. string manipulation
    By rescue in forum Symbian
    Replies: 3
    Last Post: 2009-10-15, 12:07
  2. C++ 學習程序2
    By hanwen813 in forum [Archived] Other Programming Discussion 关于其他编程技术的讨论
    Replies: 32
    Last Post: 2009-04-02, 09:10
  3. how to string manipulation?
    By rsf in forum Symbian
    Replies: 2
    Last Post: 2007-11-26, 14:49
  4. String manipulation in Symbian.
    By khurshed79 in forum Symbian
    Replies: 3
    Last Post: 2005-08-09, 07:48
  5. D211 new linux driver 1.04 not working !!
    By franz_meyer in forum Multimodecards
    Replies: 1
    Last Post: 2002-12-12, 08:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×