[How to remove all invalid characters ('/','¥','<',...) in a string before using it to be a new file name]


if newfileName is unchecked for invalid characters before “copyFile” activity, error will happen

Hi,

Can you try the following?

 String.Join("",fileName.Split(System.IO.Path.GetInvalidFileNameChars))

Note: The above also removes path separator (\). So you need to extract just filename in advance.

Regards,

1 Like


Thank you Yoichi so much, it works well after I tried your suggestion.
<3.<3

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.