26.6.23字符串

字符串

  1. 拼接:"+"、s.conact

  2. 比较:a.equals(b)、a.equalsIngoerCase(b)

  3. 截断:s.substring(a,b)a:起始位置(包含),b:结束位置(不包含)

  4. s.split(" "):分解、s.trim()去首尾空格

  5. 替换::s.replace("a","b")、s.replaceAll("a|c","b")

  6. 大小写替换:s.toLowerCase()、s.toUpperCase()

  7. 查找:s.toCharArray()、s.getBytes()、s.charAt()

  8. StringBuilder:构建字符串

posted @ 2026-06-23 16:43  yyyyyxxxxx  阅读(0)  评论(0)    收藏  举报