473,401 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

replace string

hi,
I have a url which is a char *

char * url = "/url=%2Fhome%2Fsumit%2Fpackages%2Fmyxml.xml";

when i send this URL to http server it was like -

"/url=/home/sumit/pacakges/myxml.xml"

but when it get by http server it convert '/' to '%2F' i have to
reconvert it to '/'
i did so many string operation but i did not get real string ,
still i am trying. can anyone please give me idea how to replace '%2F' to
'/'
Thanks


Nov 4 '08 #1
17 2280
Sumit wrote:
hi,
I have a url which is a char *

char * url = "/url=%2Fhome%2Fsumit%2Fpackages%2Fmyxml.xml";

when i send this URL to http server it was like -

"/url=/home/sumit/pacakges/myxml.xml"

but when it get by http server it convert '/' to '%2F' i have to
reconvert it to '/'
i did so many string operation but i did not get real string ,
still i am trying. can anyone please give me idea how to replace '%2F' to
'/'
char url[] = "/url=%2Fhome%2Fsumit%2Fpackages%2Fmyxml.xml";
char *p;
while ((p = strstr(url, "%2F")) != NULL) {
*p = '/';
memmove (p+1, p+3, strlen(p+2));
}

Note the change in the first line. Also note that this is not
especially efficient, nor tremendously flexible -- but it's what you
asked for, so ...

--
Er*********@sun.com

Nov 4 '08 #2
On 4 Nov 2008 at 17:02, Eric Sosman wrote:
char url[] = "/url=%2Fhome%2Fsumit%2Fpackages%2Fmyxml.xml";
char *p;
while ((p = strstr(url, "%2F")) != NULL) {
*p = '/';
memmove (p+1, p+3, strlen(p+2));
}

Also note that this is not especially efficient, nor tremendously
flexible
Talk about the understatement of the century - that's right out of the
Richard Heath Field school of efficiency.

Do you get a kick out of mocking new posters by trying to lead them down
the garden path with a deliberately silly solution Eric?

Nov 4 '08 #3
Sumit wrote, On 04/11/08 16:53:
hi,
I have a url which is a char *

char * url = "/url=%2Fhome%2Fsumit%2Fpackages%2Fmyxml.xml";

when i send this URL to http server it was like -

"/url=/home/sumit/pacakges/myxml.xml"
It may look like that, but if the string is defined using "%2F" then I
would expect that to be what is actually transmitted.
but when it get by http server it convert '/' to '%2F' i have to
reconvert it to '/'
i did so many string operation but i did not get real string ,
still i am trying. can anyone please give me idea how to replace '%2F' to
'/'
Show us your attempt. Doing this processing is not difficult, just scan
the string for a % and treat the following two characters as a hex
number representing the required character then copy the rest of the
string (whilst still looking for % characters). Of course, you also have
to decide what to do with invalid input.
--
Flash Gordon
If spamming me sent it to sm**@spam.causeway.com
If emailing me use my reply-to address
See the comp.lang.c Wiki hosted by me at http://clc-wiki.net/
Nov 4 '08 #4

"Sumit" <su********@gmail.comwrote in message
news:49***********************@news.sunsite.dk...
hi,
I have a url which is a char *

char * url = "/url=%2Fhome%2Fsumit%2Fpackages%2Fmyxml.xml";

when i send this URL to http server it was like -

"/url=/home/sumit/pacakges/myxml.xml"

but when it get by http server it convert '/' to '%2F' i have to
reconvert it to '/'
i did so many string operation but i did not get real string ,
still i am trying. can anyone please give me idea how to replace '%2F' to
'/'
The following might work. But you probably need a more general solution.

#include <string.h>

void fixstring(char *s) {
char *t,*u,*v;

t=u=s;
v=s+strlen(s)-3; /* Last possible %2F position */

/* copy chars from *u to *t, replacing %2F sequences with / */

while (*u) {
if (u<=v && *u=='%' && *(u+1)=='2' && *(u+2)=='F') {
*t++='/';
u+=3;
}
else
*t++=*u++;
}
*t=0;
}
Nov 4 '08 #5
"Bartc" <bc@freeuk.comwrites:
"Sumit" <su********@gmail.comwrote in message
news:49***********************@news.sunsite.dk...
>hi,
I have a url which is a char *

char * url = "/url=%2Fhome%2Fsumit%2Fpackages%2Fmyxml.xml";

when i send this URL to http server it was like -

"/url=/home/sumit/pacakges/myxml.xml"

but when it get by http server it convert '/' to '%2F' i have to
reconvert it to '/'
i did so many string operation but i did not get real string ,
still i am trying. can anyone please give me idea how to replace '%2F' to
'/'

The following might work. But you probably need a more general solution.

#include <string.h>

void fixstring(char *s) {
char *t,*u,*v;

t=u=s;
v=s+strlen(s)-3; /* Last possible %2F position */
This can make v invalid. You can get undefined behaviour just by
computing it. Having computed it you can't ask if u <= v (and get a
defined result) although it often works.
/* copy chars from *u to *t, replacing %2F sequences with / */

while (*u) {
if (u<=v && *u=='%' && *(u+1)=='2' && *(u+2)=='F') {
I like to write this sort of test like this:

if (u <= v && strncmp(u, "%2F", 3) == 0)

since it makes what is sought so very clear.
*t++='/';
u+=3;
}
else
*t++=*u++;
}
*t=0;
}
I now feel I must show an tell so I am not just being negative. I'd
write it like this:

char *decode_hex(char *dest, const char *src)
{
char c, *dp = dest;
while ((c = *src++) != '\0') {
int nc;
unsigned int uc;
if (c == '%' && sscanf(src, "%2x%n", &uc, &nc) == 1 && nc == 2) {
src += nc;
*dp++ = uc;
}
else *dp++ = c;
}
*dp = '\0';
return dest;
}

The return of the string is just for convenience in larger expressions
and separating the source from the destination (which can, of course,
be the same) allows the function to be used on unmodifiable strings.

--
Ben.
Nov 4 '08 #6

"Ben Bacarisse" <be********@bsb.me.ukwrote in message
news:87************@bsb.me.uk...
"Bartc" <bc@freeuk.comwrites:
>"Sumit" <su********@gmail.comwrote in message
news:49***********************@news.sunsite.dk. ..
>>hi,
I have a url which is a char *

char * url = "/url=%2Fhome%2Fsumit%2Fpackages%2Fmyxml.xml";

when i send this URL to http server it was like -

"/url=/home/sumit/pacakges/myxml.xml"

but when it get by http server it convert '/' to '%2F' i have to
reconvert it to '/'
i did so many string operation but i did not get real string ,
still i am trying. can anyone please give me idea how to replace '%2F'
to
'/'

The following might work. But you probably need a more general solution.

#include <string.h>

void fixstring(char *s) {
char *t,*u,*v;

t=u=s;
v=s+strlen(s)-3; /* Last possible %2F position */

This can make v invalid. You can get undefined behaviour just by
computing it. Having computed it you can't ask if u <= v (and get a
defined result) although it often works.
Yes I was wondering if there was a problem in the rare case where v becomes
(or would become) negative.

--
Bartc

Nov 5 '08 #7

Sumit <su********@gmail.comwrote in message
news:49***********************@news.sunsite.dk...
hi,
I have a url which is a char *

char * url = "/url=%2Fhome%2Fsumit%2Fpackages%2Fmyxml.xml";

when i send this URL to http server it was like -

"/url=/home/sumit/pacakges/myxml.xml"

but when it get by http server it convert '/' to '%2F' i have to
reconvert it to '/'
i did so many string operation but i did not get real string ,
still i am trying. can anyone please give me idea how to replace '%2F' to
'/'
Well, I could tell you exactly how to do it, but it might be easier
to use an existing library that can encode/decode URLs, which
appears to be what you want to do (the big advantage is of
course that you don't have to re-invent not just one wheel, but
dozens of them).

I hate to mention a specific one, but Microsoft (shudder!)
has something called "wininet" which is an API that works
with the DLLs that provide client/server Internet functions
to Windows Internet applications; there might be others available
for other systems if you look for them.

It really does look like you have a very specific system issue
that requires that URLs be encoded (because of the "reserved"
nature of certain URL characters), and if you find a suitable API,
you can just call a function to encode/decode the URLs as needed.

For some specific background info on the topic, you can
go to the original RFC 2396 by Berners-Lee...

---
William Ernest Reid

Nov 5 '08 #8
On Tue, 04 Nov 2008 18:31:35 +0000, Antoninus Twink wrote:
>On 4 Nov 2008 at 17:02, Eric Sosman wrote:
char url[] = "/url=%2Fhome%2Fsumit%2Fpackages%2Fmyxml.xml";
char *p;
while ((p = strstr(url, "%2F")) != NULL) {
*p = '/';
memmove (p+1, p+3, strlen(p+2));
}
...SNIP...
Do you get a kick out of mocking new posters by trying to lead them down
the garden path with a deliberately silly solution Eric?

I don't see anything silly in it, except if:

1) it is totally inefficient.
2) it does not handle the last %2F. I mean if %2F is at end of the url,
then will memove go beyond the array ?

--
www.lispmachine.wordpress.com
my email is @ the above blog.
Google Groups is UnBlocked now :)
Nov 5 '08 #9
On Tue, 04 Nov 2008 23:50:56 +0000, Ben Bacarisse wrote:
....SNIP...
I now feel I must show an tell so I am not just being negative. I'd
write it like this:

char *decode_hex(char *dest, const char *src)
{
char c, *dp = dest;
while ((c = *src++) != '\0') {
int nc;
unsigned int uc;
if (c == '%' && sscanf(src, "%2x%n", &uc, &nc) == 1 && nc == 2) {
src += nc;
*dp++ = uc;
}
else *dp++ = c;
}
*dp = '\0';
return dest;
}
The return of the string is just for convenience in larger expressions
and separating the source from the destination (which can, of course,
be the same) allows the function to be used on unmodifiable strings.


How about this ?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int slash_converter( const char* );
int main( void )
{
char url[] = "%2F%2Fhttp::%2F%2F%2F%2Fwww.google.com%2F";

if( slash_converter(url) )
{
fprintf(stderr,"Can not allocate memory\n");
exit(EXIT_FAILURE);
}

return 0;
}
int slash_converter( const char* pc )
{
const int SUCCESS = 0;
const int FAILURE = 1;

char REPLACE_WORD[] = "%2F";
const int REPLACE_WORD_LENGTH = strlen(REPLACE_WORD);
int INSIDE_MOD = 0;

char* new_arr = NULL;
const long arr_size = strlen(pc) + 1;

new_arr = malloc( arr_size + sizeof(*new_arr));
if( !new_arr )
{
return FAILURE;
}
while( *pc )
{
if( strncmp(pc, REPLACE_WORD, REPLACE_WORD_LENGTH) == 0 )
{
INSIDE_MOD = 1;
}

if( INSIDE_MOD )
{
*new_arr++ = '/';
pc += REPLACE_WORD_LENGTH ;
INSIDE_MOD = 0;
}
else
{
*new_arr++ = *pc++;
}
}
return SUCCESS;
}

--
www.lispmachine.wordpress.com
my email is @ the above blog.
Google Groups is UnBlocked now :)
Nov 5 '08 #10
arnuld wrote:
>On Tue, 04 Nov 2008 18:31:35 +0000, Antoninus Twink wrote:
>>On 4 Nov 2008 at 17:02, Eric Sosman wrote:
char url[] = "/url=%2Fhome%2Fsumit%2Fpackages%2Fmyxml.xml";
char *p;
while ((p = strstr(url, "%2F")) != NULL) {
*p = '/';
memmove (p+1, p+3, strlen(p+2));
}
>...SNIP...
>Do you get a kick out of mocking new posters by trying to lead them down
the garden path with a deliberately silly solution Eric?


I don't see anything silly in it, except if:

1) it is totally inefficient.
Any measurements? Against what alternatives? Describe
the use case more fully: How long are these strings, how many
"%2F" sequences appear in them, how many of them need to be
processed? How many strings must you process with the (as yet
unknown) faster alternative before you break even on the time
spent writing it?

Sorry for the rant, but phrases like "totally inefficient"
when unaccompanied by even the barest whisper of an estimate,
much less a measurement, are totally stupid.
2) it does not handle the last %2F. I mean if %2F is at end of the url,
then will memove go beyond the array ?
Yes it does, and no it won't.

--
Eric Sosman
es*****@ieee-dot-org.invalid
Nov 5 '08 #11
arnuld <su*****@invalid.addresswrites:
>On Tue, 04 Nov 2008 23:50:56 +0000, Ben Bacarisse wrote:
<snip>
[All about replacing %2F with '/' in a string.]
How about this ?
<snip headers and main>
>
int slash_converter( const char* pc )
An int returning function that is passed a const char * can only
compute an int based on that string. It can't change the string, and
it can't return a new string. This must be wrong.
{
const int SUCCESS = 0;
const int FAILURE = 1;

char REPLACE_WORD[] = "%2F";
const int REPLACE_WORD_LENGTH = strlen(REPLACE_WORD);
int INSIDE_MOD = 0;

char* new_arr = NULL;
const long arr_size = strlen(pc) + 1;

new_arr = malloc( arr_size + sizeof(*new_arr));
Two things. (1) Why can't new_arr be initialised with the value you
want it to have? You do that for all the other variables. (2) This
space will be leaked since you don't free it and you can't get the
pointer out of this function.
if( !new_arr )
{
return FAILURE;
}
while( *pc )
{
if( strncmp(pc, REPLACE_WORD, REPLACE_WORD_LENGTH) == 0 )
{
INSIDE_MOD = 1;
}

if( INSIDE_MOD )
{
*new_arr++ = '/';
pc += REPLACE_WORD_LENGTH ;
INSIDE_MOD = 0;
}
else
{
*new_arr++ = *pc++;
}
}
You need to re-work this to get rid of INSIDE_MOD. You set it to 1,
immediately test it and set it to zero again. Just put the code it
controls where you set it!
return SUCCESS;
}
--
Ben.
Nov 5 '08 #12
Eric Sosman wrote:
arnuld wrote:
>>On Tue, 04 Nov 2008 18:31:35 +0000, Antoninus Twink wrote:
>>>On 4 Nov 2008 at 17:02, Eric Sosman wrote:
char url[] = "/url=%2Fhome%2Fsumit%2Fpackages%2Fmyxml.xml";
char *p;
while ((p = strstr(url, "%2F")) != NULL) {
*p = '/';
memmove (p+1, p+3, strlen(p+2));
}
....
> 1) it is totally inefficient.

Any measurements? Against what alternatives? Describe
It restarts the search from the beginning of the url for each pass
through the loop. It should resume the search just after the point where
the previous search ended. I don't think that "totally" is justified;
depending upon the typical size of the search string and the probability
of finding "%2F", it might be a completely insignificant inefficiency;
but it is inefficient.

Nov 5 '08 #13
Eric Sosman <es*****@ieee-dot-org.invalidwrites:
arnuld wrote:
>>On Tue, 04 Nov 2008 18:31:35 +0000, Antoninus Twink wrote:
>>>On 4 Nov 2008 at 17:02, Eric Sosman wrote:
char url[] = "/url=%2Fhome%2Fsumit%2Fpackages%2Fmyxml.xml";
char *p;
while ((p = strstr(url, "%2F")) != NULL) {
*p = '/';
memmove (p+1, p+3, strlen(p+2));
}
>>...SNIP...
>>Do you get a kick out of mocking new posters by trying to lead them down
the garden path with a deliberately silly solution Eric?


I don't see anything silly in it, except if:

1) it is totally inefficient.

Any measurements? Against what alternatives? Describe
the use case more fully: How long are these strings, how many
"%2F" sequences appear in them, how many of them need to be
processed? How many strings must you process with the (as yet
unknown) faster alternative before you break even on the time
spent writing it?

Sorry for the rant, but phrases like "totally inefficient"
when unaccompanied by even the barest whisper of an estimate,
much less a measurement, are totally stupid.
Its worst case behaviour is Theta(n^2). There's a trivial
Theta(n) worst case solution, so there's no reason for
anything omega(n).

We're not told anything about the possible inputs, so assuming
they're always small and with a small number of '/' replacements
isn't necessarily justified. How inefficient is it? How long's
a URL?

Phil
--
We must respect the other fellow's religion, but only in the sense and to the
extent that we respect his theory that his wife is beautiful and his children
smart. -- Henry Louis Mencken (1880-1956), American editor and critic
Nov 5 '08 #14
On Wed, 05 Nov 2008 14:09:06 +0000, Ben Bacarisse wrote:
An int returning function that is passed a const char * can only
compute an int based on that string. It can't change the string, and
it can't return a new string. This must be wrong.

SO should I return void (which is what I thought earlier) but what if
there is some error in the process ?
Two things. (1) Why can't new_arr be initialised with the value you
want it to have? You do that for all the other variables. (2) This
space will be leaked since you don't free it and you can't get the
pointer out of this function.

ouch! I forgot to free(). Anyway, I am doing a static allocation.
Malloc() was used there because my friend wanted it anyway without any
solid reason :-\
You need to re-work this to get rid of INSIDE_MOD. You set it to 1,
immediately test it and set it to zero again.
Thats is intended because it will not be set to 1 most of the times. If
the comparison is false then it will simply go to next if-else clause.
2nd, there is anew problem now. I have to work on 19 different comparisons
instead of one. A URI has 19 conversion taking place e.g. %3F for a "?" in
URI. See the Percent-encoding_reserved_characters section here:

http://en.wikipedia.org/wiki/Percent-encoding

Just put the code it controls where you set it!
I don't know what you mean. Here is the new uncompilable code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void slash_converter( const char*, const int );
int main( void )
{
char url[] = "%2F%2Fhttp://google.com%2F";
const int arr_size = strlen(url);
slash_converter(url, arr_size);

return 0;
}
void slash_converter( const char* pc, const int arr_size )
{
char new_arr[arr_size+1] = {0};

char replace_word[] = "%2F";
char replacement = '/';
const int REPLACE_WORD_LENGTH = strlen(replace_word);
while( *pc )
{
if( strncmp(pc, replace_word, REPLACE_WORD_LENGTH) == 0 )
{
*new_arr++ = replacement;
pc += REPLACE_WORD_LENGTH ;
}
else
{
*new_arr++ = *pc++;
}
}
}

==================== OUTPUT ==========================
[arnuld@dune C]$ gcc4 -ansi -pedantic -Wall -Wextra slash-converter.c
slash-converter.c: In function ‘slash_converter’:
slash-converter.c:22: warning: ISO C90 forbids variable-size array ‘new_arr’
slash-converter.c:22: error: variable-sized object may not be initialized
slash-converter.c:22: warning: excess elements in array initializer
slash-converter.c:22: warning: (near initialization for ‘new_arr’)
slash-converter.c:33: error: invalid lvalue in increment
slash-converter.c:38: error: invalid lvalue in increment
[arnuld@dune C]$


Line 22: char new_arr[arr_size] = {0};

I really don't understand how this is variable size array when I am giving
the array size at compile time.
--
www.lispmachine.wordpress.com
my email is @ the above blog.
Google Groups is UnBlocked now :)
Nov 6 '08 #15
On 04 Nov 2008 16:53:03 GMT, Sumit <su********@gmail.comwrote:
>hi,
I have a url which is a char *

char * url = "/url=%2Fhome%2Fsumit%2Fpackages%2Fmyxml.xml";

when i send this URL to http server it was like -

"/url=/home/sumit/pacakges/myxml.xml"

but when it get by http server it convert '/' to '%2F' i have to
reconvert it to '/'
i did so many string operation but i did not get real string ,
still i am trying. can anyone please give me idea how to replace '%2F' to
'/'
Thanks
Your native language is obviously not English. Because of that and
possibly just a general confusion, you have not asked *exactly* the
right question to elicit a good answer from many of the regulars on clc.
You are obviously confused about why the slashes are replaced by the
string '%2F'. You can get a fairly good explanation at
<http://en.wikipedia.org/wiki/Query_string>. The question and the
answer are slightly off-topic in this group, but I am glad to help.
------------------------------------------------------------------------

BTW, this reminds me of a joke.

A man in a small plane without instruments was en route to the Microsoft
airstrip when he encountered a heavy fog. After flying around for a
while he suddenly spotted a building, and a man peering out of a window.
He cut the engine and shouted across "Where am I?" the answer was
"You're in a plane." He knew immediately that he was at Microsoft
because he got an answer that was completely accurate, and deliberately
confusing.

This was originally told about IBM, before there was a Microsoft.
--
There is no one so stupid or ignorant
that I can't learn something from him/her.
Nov 6 '08 #16
arnuld wrote:
>On Wed, 05 Nov 2008 14:09:06 +0000, Ben Bacarisse wrote:
>An int returning function that is passed a const char * can only
compute an int based on that string. It can't change the string, and
it can't return a new string. This must be wrong.


SO should I return void (which is what I thought earlier) but what if
there is some error in the process ?
You're missing the point. Your program allocates memory for a new string
that contains the converted string, but the interface of your program
provides no way of letting the caller make use of that string. There are
two main possibilities:

char * slash_converter( const char* pc )

would allow you to return a pointer to the newly allocated string, and
to return NULL in case of any fatal error.

int slash_converter( char **out, const char* pc )

With this version, the user would create a char* pointer, then pass a
pointer to that pointer to slash_converter(). slash_converter would then
store the pointer returned by malloc() into *out.
>Two things. (1) Why can't new_arr be initialised with the value you
want it to have? You do that for all the other variables. (2) This
space will be leaked since you don't free it and you can't get the
pointer out of this function.


ouch! I forgot to free(). Anyway, I am doing a static allocation.
Malloc() was used there because my friend wanted it anyway without any
solid reason :-\
If you want the caller to provide the memory for the output string, you
can change "out" to "char*".

....
>Just put the code it controls where you set it!

I don't know what you mean. ...
Just replace:

if( strncmp(pc, REPLACE_WORD, REPLACE_WORD_LENGTH) == 0 )
{
INSIDE_MOD = 1;
}

if( INSIDE_MOD )
{

With

if( strncmp(pc, REPLACE_WORD, REPLACE_WORD_LENGTH) == 0 )
{
... Here is the new uncompilable code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void slash_converter( const char*, const int );
int main( void )
{
char url[] = "%2F%2Fhttp://google.com%2F";
const int arr_size = strlen(url);
slash_converter(url, arr_size);

return 0;
}
void slash_converter( const char* pc, const int arr_size )
{
char new_arr[arr_size+1] = {0};

char replace_word[] = "%2F";
char replacement = '/';
const int REPLACE_WORD_LENGTH = strlen(replace_word);
while( *pc )
{
if( strncmp(pc, replace_word, REPLACE_WORD_LENGTH) == 0 )
{
*new_arr++ = replacement;
pc += REPLACE_WORD_LENGTH ;
}
else
{
*new_arr++ = *pc++;
}
}
}

==================== OUTPUT ==========================
[arnuld@dune C]$ gcc4 -ansi -pedantic -Wall -Wextra slash-converter.c
slash-converter.c: In function ‘slash_converter’:
slash-converter.c:22: warning: ISO C90 forbids variable-size array ‘new_arr’
slash-converter.c:22: error: variable-sized object may not be initialized
slash-converter.c:22: warning: excess elements in array initializer
slash-converter.c:22: warning: (near initialization for ‘new_arr’)
slash-converter.c:33: error: invalid lvalue in increment
slash-converter.c:38: error: invalid lvalue in increment
[arnuld@dune C]$


Line 22: char new_arr[arr_size] = {0};

I really don't understand how this is variable size array when I am giving
the array size at compile time.
The value of arr_size is not known at compile time. arr_size is a
variable, and that's what makes new_arr[] a variable size array.

In your original version, your program filled in the array pointed at by
new_array, and then provided no way for the caller to access that array.
That was a memory leak. Your new version fills in an array named
new_array, which disappears at the end of your function, so you couldn't
even give the caller access to that array if you wanted to.
Nov 6 '08 #17
arnuld wrote:
>
.... snip ...
>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void slash_converter( const char*, const int );

int main( void )
{
char url[] = "%2F%2Fhttp://google.com%2F";
const int arr_size = strlen(url);

slash_converter(url, arr_size);
Think of it this way. You are passing a char* pointer and an
integer to slash_converter. You have told slash_converter NOT to
alter what the pointer points to, nor the integer (by the
'const'). You have told slash_converter not to return anything
(the void). So all slash_converter can do is spin its wheels and
waste time; it CANNOT affect anything else (other than global
variables, which it doesn't use).

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
Nov 6 '08 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: higabe | last post by:
Three questions 1) I have a string function that works perfectly but according to W3C.org web site is syntactically flawed because it contains the characters </ in sequence. So how am I...
13
by: M | last post by:
Hi, I've searched through the previous posts and there seems to be a few examples of search and replacing all occurrances of a string with another string. I would have thought that the code...
22
by: Phlip | last post by:
C++ers: Here's an open ended STL question. What's the smarmiest most templated way to use <string>, <algorithms> etc. to turn this: " able search baker search charlie " into this: " able...
9
by: Crirus | last post by:
dim pp as string pp="{X=356, Y=256}{X=356, Y=311.2285}{X=311.2285, Y=356}{X=256, Y=356}{X=200.7715, Y=356}{X=156, Y=311.2285}{X=156, Y=256}{X=156, Y=200.7715}{X=200.7715, Y=156}{X=256,...
9
by: Peter Row | last post by:
Hi, I know this has been asked before, but reading the threads it is still not entirely clear. Deciding which .Replace( ) to use when. Typically if I create a string in a loop I always use a...
4
by: Cor | last post by:
Hi Newsgroup, I have given an answer in this newsgroup about a "Replace". There came an answer on that I did not understand, so I have done some tests. I got the idea that someone said,...
5
by: djc | last post by:
I need to prepare a large text database field to display in an asp.net repeater control. Currently I am replacing all chr(13)'s with a "<br/>" and it works fine. However, now I also want to be able...
10
by: pamelafluente | last post by:
I need to replace all the occurences of a string within another string (or stringbuilder): Function ReplaceInsensitive(ByVal InputString As String, _ ByVal SubstringReplaced As String, _ ByVal...
5
by: V S Rawat | last post by:
I was trying to use back-to-back replace functions to convert a url: str1 = str.replace("%2F","/").replace("%3F","?").replace("%3D","=").replace("%2 6","&"); It didn't replace all 4 types of...
1
by: NvrBst | last post by:
I want to use the .replace() method with the regular expression /^ %VAR % =,($|&)/. The following DOESN'T replace the "^default.aspx=,($|&)" regular expression with "":...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.