相关文章推荐
淡定的盒饭  ·  ASP.NET 核心 Blazor ...·  1 周前    · 
傻傻的馒头  ·  STRING_SPLIT ...·  1 周前    · 
豪爽的炒面  ·  + (字串串連) ...·  2 月前    · 
英俊的哑铃  ·  python ...·  2 年前    · 
近视的花卷  ·  react 读取本地json-掘金·  2 年前    · 
奋斗的麦片  ·  no viable alternative ...·  2 年前    · 
/**
* windows下文件名中不能含有:\ / : * ? " < > | 英文的这些字符 ,这里使用"."、"'"进行替换。
*解决:保存文件文件名不正确问题
* 解决:文件名、目录名或卷标语法不正确。
*
* \/:?| 用.替换
*
* "<> 用'替换
*/
public static String getConversionFileName(String dirPath) {
dirPath = dirPath.replaceAll("[/\\\\:*?|]", ".");
dirPath = dirPath.replaceAll("[\"<>]", "'");
return dirPath;
}