public static void main(String[] args) {
        String str = "[测试}";
        if (str.startsWith("[")) {
            System.out.println(String.format("首位:["));
        }
        if (str.endsWith("+")) {
            System.out.println(String.format("首位:}"));
        }
    }

【Java】+获取字符串首位和末位

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案