At 1:01 PM -0400 7/19/01, Troy Rollins wrote:
>If I have a variable with a known character, say ".", and I want to replace
>everything after it with new characters - what is the proper syntax?
>
>In this case, my variable holds a file name, and I want to change it's
>extension. I've tried such things as getting the offset of ".", and then
>putting empty into (chars > it), as well as a host of other approaches -
>none of which worked.

If you know what the extension is, use replace:

replace ".txt" with ".htm" in tFileName

if you don't know what the extension is, use replaceText:

put replaceText(tFileName, "\..*" , ".htm") into tFileName

The replaceText function above will find the first "." and then replace that and 
everything after it (no matter what it is or how long it is) with ".htm"

gc

Reply via email to