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

[REBOL] Re: can't quite get it right...

From: al:bri:xtra at: 7-Sep-2001 17:55

> I'm trying to replace uppercase letters in a string with "[Aa]" (if the
letter is "A") Here's a better solution:
>> String: "Forrest Gump"
== "Forrest Gump"
>> String: map String func [Letter [char!]][either all [#"A" <= Letter
Letter <= #"Z"][rejoin ["[" Letter lowercase to-string Letter "]"]][Letter]] == "[Ff]orrest [Gg]ump"
>> string
== "[Ff]orrest [Gg]ump"
>>
Andrew Martin ICQ: 26227169 http://zen.scripterz.org