> Now, the next step would be to generalize this stuff in case you need
> it again in the future:
>
>     change-suffix: func [
>         {Changes the suffix of the string and returns the updated string.}
>         string [any-string!] "The file, url, string, etc. to change."
>         suffix [any-string!] "The new suffix."
>         /local s
>     ][
>         attempt [if #"." <> first suffix [suffix: join %. suffix]]
>         append either s: find string suffix? string [clear s][string]
suffix
>     ]

You might find this function helpful:

Extension: function [
 "Changes the extension of the path to the specified extension."
 Path [file! url!]
 Ext [file!] "Like: %.txt"
 ] [Dot] [
 all [
  Dot: any [find/last Path #"." tail Path]
  not find Dot #"/"
  clear Dot
  append Path Ext
  ]
 ]

Andrew J Martin
Speaking in tongues and performing miracles.
ICQ: 26227169
http://www.rebol.it/Valley/
http://valley.orcon.net.nz/
http://Valley.150m.com/
-><-

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to