Commit 88aafb9b authored by yanzg's avatar yanzg

Excel导出功能

parent 576641ec
package com.yanzuoguang.util.helper;
import com.yanzuoguang.util.contants.SystemContants;
import com.yanzuoguang.util.exception.CodeException;
import java.net.*;
......@@ -9,6 +10,7 @@ import java.util.List;
/**
* 地址字符串处理
*
* @author 颜佐光
*/
public class UrlHelper {
......@@ -97,4 +99,32 @@ public class UrlHelper {
}
return ipList;
}
/**
* 处理是否斜线分隔符结尾
*
* @param url 需要处理的地址
* @return 处理后的结果
*/
public static String dealWithUrl(String url) {
if (!url.endsWith(SystemContants.SLASH) || !url.endsWith(SystemContants.UNSLASH)) {
url += SystemContants.SLASH;
}
return url;
}
/**
* 处理双斜线
* <p>
* 1、\\ --> /
* 2、// --> /
*
* @param url 需要处理的地址
* @return 处理后的结果
*/
public static String dealUrlDoubleChar(String url) {
return url.replaceAll(SystemContants.SLASH + SystemContants.SLASH, SystemContants.SLASH).
replaceAll(SystemContants.UNSLASH + SystemContants.UNSLASH, SystemContants.SLASH);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment