StringUtils.java 571 B

12345678910111213141516171819202122232425262728
  1. package com.ruoyi.common.utils;
  2. import cn.hutool.core.util.StrUtil;
  3. import com.ruoyi.common.constant.Constants;
  4. /**
  5. * 字符串工具类
  6. *
  7. * @author ruoyi
  8. */
  9. public class StringUtils extends org.apache.commons.lang3.StringUtils {
  10. /** 空字符串 */
  11. private static final String NULLSTR = "";
  12. /** 下划线 */
  13. private static final char SEPARATOR = '_';
  14. /**
  15. * 是否为http(s)://开头
  16. *
  17. * @param link 链接
  18. * @return 结果
  19. */
  20. public static boolean ishttp(String link) {
  21. return StrUtil.startWithAny(link, Constants.HTTP, Constants.HTTPS);
  22. }
  23. }