/[classpath]/classpath/java/lang/String.java
ViewVC logotype

Diff of /classpath/java/lang/String.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.32 by tromey, Mon Jul 23 20:01:44 2001 UTC revision 1.33 by jewel, Sun Aug 5 01:40:04 2001 UTC
# Line 1128  Character.toLowerCase(value[i]) == Chara Line 1128  Character.toLowerCase(value[i]) == Chara
1128      internTable.put(this, this);      internTable.put(this, this);
1129      return this;      return this;
1130    }    }
1131    
1132      /**
1133       * Creates a string from the character array. The array is first copied.
1134       *
1135       * @param data the array of characters
1136       *
1137       * @return a String object that contains the characters of the character array
1138       */
1139      
1140      public static String copyValueOf(char[] data) {
1141        char[] duplicate = (char[]) data.clone();
1142        return new String(duplicate);
1143      }
1144    
1145      /**
1146       * Creates a string from the specifed character subarray. The array is first copied.
1147       *
1148       * @param data the array of characters
1149       * @param offset the array index indicating the start of the subarray
1150       * @param count the number of characters to use for the subarray
1151       *
1152       * @return a String object that contains the characters of the character subarray
1153       */
1154      
1155      public static String copyValueOf(char[] data, int offset, int count) {
1156        char[] duplicate = new char[count];
1157        System.arraycopy(duplicate, 0, data, offset, count);
1158        return new String(duplicate);
1159      }
1160  }  }

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26