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

    getChars() 方法将字符从字符串复制到目标字符数组。 语法 public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) 参数 srcBegin -- 字符串中要复制的第一个字符的索引。 srcEnd -- 字符串中...

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

    hashCode() 方法用于返回字符串的哈希码。 字符串对象的哈希码根据以下公式计算: s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1] 使用 int 算法,这里 s[i] 是字符串的第 i 个字符的 ASCII 码,n 是字符...

  • Java String indexOf() 方法 日期:2022-10-11 点击:6867 java

    indexOf() 方法有以下四种形式: public int indexOf(int ch): 返回指定字符在字符串中第一次出现处的索引,如果此字符串中没有这样的字符,则返回 -1。 public int indexOf(int ch, int fromIndex): 返回...

  • Java String indexOf() 方法 日期:2022-10-11 点击:1545 java

    indexOf() 方法有以下四种形式: public int indexOf(int ch): 返回指定字符在字符串中第一次出现处的索引,如果此字符串中没有这样的字符,则返回 -1。 public int indexOf(int ch, int fromIndex): 返回...

  • Java String indexOf() 方法 日期:2022-10-11 点击:6855 java

    indexOf() 方法有以下四种形式: public int indexOf(int ch): 返回指定字符在字符串中第一次出现处的索引,如果此字符串中没有这样的字符,则返回 -1。 public int indexOf(int ch, int fromIndex): 返回...

  • Java String indexOf() 方法 日期:2022-10-11 点击:3895 java

    indexOf() 方法有以下四种形式: public int indexOf(int ch): 返回指定字符在字符串中第一次出现处的索引,如果此字符串中没有这样的字符,则返回 -1。 public int indexOf(int ch, int fromIndex): 返回...

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

    intern() 方法返回字符串对象的规范化表示形式。 它遵循以下规则:对于任意两个字符串 s 和 t,当且仅当 s.equals(t) 为 true 时,s.intern() == t.intern() 才为 true。 语法 public String intern() 参数...

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

    lastIndexOf() 方法有以下四种形式: public int lastIndexOf(int ch): 返回指定字符在此字符串中最后一次出现处的索引,如果此字符串中没有这样的字符,则返回 -1。 public int lastIndexOf(int ch, in...

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

    lastIndexOf() 方法有以下四种形式: public int lastIndexOf(int ch): 返回指定字符在此字符串中最后一次出现处的索引,如果此字符串中没有这样的字符,则返回 -1。 public int lastIndexOf(int ch, in...

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

    lastIndexOf() 方法有以下四种形式: public int lastIndexOf(int ch): 返回指定字符在此字符串中最后一次出现处的索引,如果此字符串中没有这样的字符,则返回 -1。 public int lastIndexOf(int ch, in...