i'd like to change the specific charactor.....

Login to reply to this topic.
Mon, 2005-08-01 13:41
Joined: 2005-07-12
Forum posts: 8
i want to change the specific charactor in the middle of string to some charactor....
using for loop....but it didn't work.....i don't know i can't find anything wrong....
is this right??
_LIT16(ch,"+");
for(int i=0;i<= aUri.Length(); i++)
   {
      if( aUri[i]=' ')
      {
         aUri.Replace(i,1,ch);
      }
   }

i want to replace 'space'  in the string to '+'..... is this possible?? or should i use different way?? plz tell me anyone know~~~ 

Mon, 2005-08-01 13:58
Joined: 2004-12-03
Forum posts: 192
Re: i'd like to change the specific charactor.....
you can try TLex
Mon, 2005-08-01 14:15
Joined: 2004-12-03
Forum posts: 192
Re: i'd like to change the specific charactor.....
something like
Code:
_LIT16(KAddition, "+");
const TChar KSeparator = ' ';
TLex16 lex(aUri);

while (lex.Peek())
{
if (lex.Get() == KSeparator)
{
aUri.Replace(lex.Offset() - 1, 1, KAddition);
}
}
Tue, 2005-08-02 06:08
Joined: 2005-07-12
Forum posts: 8
Re: i'd like to change the specific charactor.....
Thank u a lot for your reply.. it did work....i'm beginner of this symbian c++...i've been studying since last month...

i'm very lucky to find this forum....this site very useful to me...thanks....
  • Login to reply to this topic.