Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: replace

From: ryan:christiansen:intellisol at: 26-Jun-2001 14:21

I was trying to use 'try on a block containing a 'replace statement and couldn't understand why it would not return an error when trying to replace a string that doesn't exist. I guess 'replace simply doesn't error out. Why not? I think it should. -Ryan [JELINEM1--nati] onwide.com To: [rebol-list--rebol--com] Sent by: cc: rebol-bounce@ Subject: [REBOL] Re: replace rebol.com 06/26/2001 01:15 PM Please respond to rebol-list Are you are referring to the fact that the string you specified to replace, "fabulous", is not in the main string "foobar"? Or that you are trying to replace a string with itself? In the first case, no search/replace tool I've used has complained (esp given an error) that zero replaces were made. - Michael Jelinek Please help me to understand 'replace. Why doesn't the following return an error?
>> a: "foobar"
== "foobar"
>> c: "fabulous"
== "fabulous"
>> replace a c c
== "foobar"
>>
-Ryan