@Everyone - Thanks for the help. @Charlie - The regex worked perfect. Thanks for the help.
> I need to take a string and replace all the spaces with dashes. I > tried using the replace function but I am having issues with strings > that have multiple spaces next to each other and/or a space or spaces > at the end. Here is what I have: > > <cfset dirName = #Replace(String," ", "-", "ALL")#> > > Any suggestions on a better way to do this? > > Thanks in advance for any help. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Get involved in the latest ColdFusion discussions, product development sharing, and articles on the Adobe Labs wiki. http://labs/adobe.com/wiki/index.php/ColdFusion_8 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291473 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4