×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    8

    How to replace a sub-string by another in a descriptor

    Hi all,
    I really want to replace a sub-string by another in a descriptor.
    Could you please give me some ideas?
    Thanks

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,175

    Re: How to replace a sub-string by another in a descriptor

    And have you tried using the Replace function provided by the descriptor ?

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,752

    Re: How to replace a sub-string by another in a descriptor

    TDes::Replace?

  4. #4
    Registered User
    Join Date
    Dec 2010
    Posts
    8

    Re: How to replace a sub-string by another in a descriptor

    I can use Replace function, but it is provided to replace only one sub-string at once.
    So I am trying to find a Replace function which is similar to the one in C#.

  5. #5
    Registered User
    Join Date
    Jun 2007
    Location
    Mumbai, India
    Posts
    1,998

    Re: How to replace a sub-string by another in a descriptor

    Quote Originally Posted by giang1194 View Post
    I can use Replace function, but it is provided to replace only one sub-string at once.
    So I am trying to find a Replace function which is similar to the one in C#.
    Not everyone is familiar with C# here. It would help others to understand beter if you could explain it with an example.

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,752

    Re: How to replace a sub-string by another in a descriptor

    If C# is similar to Java, it replaces all occurrences of a substring with an other one.
    There is no such mechanism in Symbian C++, you have to use Find+Replace in a loop (if the replacement string contains the original one, you will also need Mid).

  7. #7
    Registered User
    Join Date
    Dec 2010
    Posts
    8

    Re: How to replace a sub-string by another in a descriptor

    Thanks wizard_hu!
    I've tried to find a function to do that. If there isn't, I think I will have to use Find+Replace functions in a loop as you have suggested.
    Thanks again!

    Sorry kamalakshan, I will write clearly from now on.

Similar Threads

  1. how to get sub string of a long string in j2me
    By mindIt in forum Mobile Java General
    Replies: 5
    Last Post: 2009-07-04, 10:05
  2. Replace character in descriptor
    By assayag in forum Symbian
    Replies: 4
    Last Post: 2009-06-05, 06:14
  3. Find and replace in descriptor.
    By giedi1 in forum Symbian
    Replies: 2
    Last Post: 2009-02-20, 09:50
  4. Replies: 2
    Last Post: 2009-01-17, 17:44
  5. How to raplace a sub string in HBufC
    By truonglekhanh_hcmuns in forum Symbian
    Replies: 2
    Last Post: 2007-07-05, 14:12

Posting Permissions

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