Remove spaces from f.displayname

I am copying a file from one location to another.
I get the filename of the source file by … OpenDialog … f.displayname

But sometimes my filename (f.displayname) contains spaces
How do I remove the spaces within the filename before I copy the file?


First, you should not need to remove spaces.

Second, check string ReplaceAll function.

Thanks - worked great!!

My issue is I have filenames stored in a table…

And when I query the filenames (in a recordset) and then try to copy the files to a new location, the files that have spaces do not work.

My basic code is…

Current_File_Location_Name= g_Current Location + recordset.column(“filename”).StringValue
Backup_File_Location_Name= g_Backup_Location + recordset.column(“filename”).StringValue

f = New FolderItem(Current_File_Location_Name)
f2 = New FolderItem(Backup_File_Location_Name)