IT入门 > 教程 >
  • Java matches() 方法 日期:2022-10-11 点击:3035 java

    matches() 方法用于检测字符串是否匹配给定的正则表达式。 调用此方法的 str.matches(regex) 形式与以下表达式产生的结果完全相同: Pattern.matches(regex, str) 语法 public boolean matches(String regex...

  • Java regionMatches() 方法 日期:2022-10-11 点击:3324 java

    regionMatches() 方法用于检测两个字符串在一个区域内是否相等。 语法 public boolean regionMatches(int toffset, String other, int ooffset, int len)或public boolean regionMatches(boolean ignoreCase, int toffset, String o...

  • Java regionMatches() 方法 日期:2022-10-11 点击:8354 java

    regionMatches() 方法用于检测两个字符串在一个区域内是否相等。 语法 public boolean regionMatches(int toffset, String other, int ooffset, int len)或public boolean regionMatches(boolean ignoreCase, int toffset, String o...

  • Java replace() 方法 日期:2022-10-11 点击:10385 java

    replace() 方法通过用 newChar 字符替换字符串中出现的所有 searchChar 字符,并返回替换后的新字符串。 语法 public String replace(char searchChar, char newChar) 参数 searchChar -- 原字符。 newChar -- 新字...

  • Java replaceAll() 方法 日期:2022-10-11 点击:7196 java

    replaceAll() 方法使用给定的参数 replacement 替换字符串所有匹配给定的正则表达式的子字符串。 语法 public String replaceAll(String regex, String replacement) 参数 regex -- 匹配此字符串的正则表达式。...

  • Java replaceFirst() 方法 日期:2022-10-11 点击:4783 java

    replaceFirst() 方法使用给定的参数 replacement 替换字符串第一个匹配给定的正则表达式的子字符串。 语法 public String replaceFirst(String regex, String replacement) 参数 regex -- 匹配此字符串的正则表...

  • Java split() 方法 日期:2022-10-11 点击:4415 java

    split() 方法根据匹配给定的正则表达式来拆分字符串。 注意: . 、 $ 、 | 和 * 等转义字符,必须得加 \\ 。 注意: 多个分隔符,可以用 | 作为连字符。 语法 public String[] split(String regex...

  • Java split() 方法 日期:2022-10-11 点击:9541 java

    split() 方法根据匹配给定的正则表达式来拆分字符串。 注意: . 、 $ 、 | 和 * 等转义字符,必须得加 \\ 。 注意: 多个分隔符,可以用 | 作为连字符。 语法 public String[] split(String regex...

  • Java startsWith() 方法 日期:2022-10-11 点击:2599 java

    startsWith() 方法用于检测字符串是否以指定的前缀开始。 语法 public boolean startsWith(String prefix, int toffset)或public boolean startsWith(String prefix) 参数 prefix -- 前缀。 toffset -- 字符串中开始查找的...

  • Java startsWith() 方法 日期:2022-10-11 点击:3063 java

    startsWith() 方法用于检测字符串是否以指定的前缀开始。 语法 public boolean startsWith(String prefix, int toffset)或public boolean startsWith(String prefix) 参数 prefix -- 前缀。 toffset -- 字符串中开始查找的...