Java Doc for String.java in  » Apache-Harmony-Java-SE » java-package » java » lang » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » java package » java.lang 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.lang.String

String
final public class String implements Serializable,Comparable<String>,CharSequence(Code)

An immutable sequence of characters/code units (chars). A String is represented by array of UTF-16 values, such that Unicode supplementary characters (code points) are stored/encoded as surrogate pairs via Unicode code units (char)


See Also:   StringBuffer
See Also:   StringBuilder
See Also:   Charset
since:
   1.0

Inner Class :static class ConsolePrintStream extends java.io.PrintStream

Field Summary
final public static  Comparator<String>CASE_INSENSITIVE_ORDER
    

Constructor Summary
public  String()
     Answers an empty string.
public  String(byte[] data)
     Converts the byte array to a String using the default encoding as specified by the file.encoding system property.
public  String(byte[] data, int high)
     Converts the byte array to a String, setting the high byte of every character to the specified value.
public  String(byte[] data, int start, int length)
     Converts the byte array to a String using the default encoding as specified by the file.encoding system property.
public  String(byte[] data, int high, int start, int length)
     Converts the byte array to a String, setting the high byte of every character to the specified value.
public  String(byte[] data, int start, int length, String encoding)
     Converts the byte array to a String using the specified encoding.
public  String(byte[] data, String encoding)
     Converts the byte array to a String using the specified encoding.
public  String(char[] data)
     Initializes this String to contain the characters in the specified character array.
public  String(char[] data, int start, int length)
     Initializes this String to contain the specified characters in the character array.
 String(int start, int length, char[] data)
    
public  String(String string)
    
public  String(StringBuffer stringbuffer)
     Creates a string from the contents of a StringBuffer.
public  String(int[] codePoints, int offset, int count)
    

Constructs a String from the sub-array of Unicode code points.

public  String(StringBuilder sb)
    

Constructs a String from a StringBuilder.


Method Summary
public  charcharAt(int index)
     Answers the character at the specified offset in this String.
public  intcodePointAt(int index)
    

Retrieves the Unicode code point value at the index.


Parameters:
  index - The index to the char code unit within thisobject.
public  intcodePointBefore(int index)
    

Retrieves the Unicode code point value that precedes the index.


Parameters:
  index - The index to the char code unit within thisobject.
public  intcodePointCount(int beginIndex, int endIndex)
    

Calculates the number of Unicode code points between beginIndex and endIndex.


Parameters:
  beginIndex - The inclusive beginning index of the subsequence.
Parameters:
  endIndex - The exclusive end index of the subsequence.
public  intcompareTo(String string)
     Compares the specified String to this String using the Unicode values of the characters.
public  intcompareToIgnoreCase(String string)
     Compare the receiver to the specified String to determine the relative ordering when the case of the characters is ignored.
public  Stringconcat(String string)
     Concatenates this String and the specified string.
public  booleancontains(CharSequence cs)
    

Determines if this String contains the sequence of characters in the CharSequence passed.


Parameters:
  cs - The character sequence to search for.
public  booleancontentEquals(StringBuffer strbuf)
     Answers whether the characters in the StringBuffer strbuf are the same as those in this String.
Parameters:
  strbuf - the StringBuffer to compare this String to true when the characters in strbuf are identical to those in thisString.
public  booleancontentEquals(CharSequence cs)
    

Compares a CharSequence to this String to determine if their contents are equal.


Parameters:
  cs - The character sequence to compare to.
public static  StringcopyValueOf(char[] data)
     Creates a new String containing the characters in the specified character array.
public static  StringcopyValueOf(char[] data, int start, int length)
     Creates a new String containing the specified characters in the character array.
public  booleanendsWith(String suffix)
     Compares the specified string to this String to determine if the specified string is a suffix.
public  booleanequals(Object object)
     Compares the specified object to this String and answer if they are equal.
public  booleanequalsIgnoreCase(String string)
     Compares the specified String to this String ignoring the case of the characters and answer if they are equal.
public static  Stringformat(String format, Object... args)
     Returns a printf-style formatted string, using the supplied format and arguments.
public static  Stringformat(Locale loc, String format, Object... args)
     Returns a printf-style formatted string, using the supplied format and arguments, accordingly to the specified locale.
public  byte[]getBytes()
     Converts this String to a byte encoding using the default encoding as specified by the file.encoding system property.
public  voidgetBytes(int start, int end, byte[] data, int index)
     Converts this String to a byte array, ignoring the high order bits of each character.
public  byte[]getBytes(String encoding)
     Converts this String to a byte encoding using the specified encoding.
public  voidgetChars(int start, int end, char[] buffer, int index)
     Copies the specified characters in this String to the character array starting at the specified offset in the character array.
 char[]getValue()
    
public  inthashCode()
     Answers an integer hash code for the receiver.
public  intindexOf(int c)
     Searches in this String for the first index of the specified character.
public  intindexOf(int c, int start)
     Searches in this String for the index of the specified character.
public  intindexOf(String string)
     Searches in this String for the first index of the specified string.
public  intindexOf(String subString, int start)
     Searches in this String for the index of the specified string.
public  Stringintern()
     Searches an internal table of strings for a string equal to this String. If the string is not in the table, it is added.
public  intlastIndexOf(int c)
     Searches in this String for the last index of the specified character.
public  intlastIndexOf(int c, int start)
     Searches in this String for the index of the specified character.
public  intlastIndexOf(String string)
     Searches in this String for the last index of the specified string.
public  intlastIndexOf(String subString, int start)
     Searches in this String for the index of the specified string.
public  intlength()
     Answers the size of this String.
public  booleanmatches(String expr)
     Determines whether a this String matches a given regular expression.
public  intoffsetByCodePoints(int index, int codePointOffset)
    

Returns the index within this object that is offset from index by codePointOffset code points.


Parameters:
  index - The index within this object to calculate the offset from.
Parameters:
  codePointOffset - The number of code points to count.
public  booleanregionMatches(int thisStart, String string, int start, int length)
     Compares the specified string to this String and compares the specified range of characters to determine if they are the same.
public  booleanregionMatches(boolean ignoreCase, int thisStart, String string, int start, int length)
     Compares the specified string to this String and compares the specified range of characters to determine if they are the same.
public  Stringreplace(char oldChar, char newChar)
     Copies this String replacing occurrences of the specified character with another character.
public  Stringreplace(CharSequence target, CharSequence replacement)
     Copies this String replacing occurrences of the specified target sequence with another sequence.
public  StringreplaceAll(String expr, String substitute)
     Replace any substrings within this String that match the supplied regular expression expr, with the String substitute.
public  StringreplaceFirst(String expr, String substitute)
     Replace any substrings within this String that match the supplied regular expression expr, with the String substitute.
public  String[]split(String expr)
     Replace any substrings within this String that match the supplied regular expression expr, with the String substitute.
public  String[]split(String expr, int max)
     Splits this String using the supplied regular expression expr.
public  booleanstartsWith(String prefix)
     Compares the specified string to this String to determine if the specified string is a prefix.
public  booleanstartsWith(String prefix, int start)
     Compares the specified string to this String, starting at the specified offset, to determine if the specified string is a prefix.
public  CharSequencesubSequence(int start, int end)
     Has the same result as the substring function, but is present so that String may implement the CharSequence interface.
public  Stringsubstring(int start)
     Copies a range of characters into a new String.
public  Stringsubstring(int start, int end)
     Copies a range of characters into a new String.
public  char[]toCharArray()
     Copies the characters in this String to a character array.
public  StringtoLowerCase()
     Converts the characters in this String to lowercase, using the default Locale.
public  StringtoLowerCase(Locale locale)
     Converts the characters in this String to lowercase, using the specified Locale.
public  StringtoString()
     Answers a string containing a concise, human-readable description of the receiver.
public  StringtoUpperCase()
     Converts the characters in this String to uppercase, using the default Locale.
public  StringtoUpperCase(Locale locale)
     Converts the characters in this String to uppercase, using the specified Locale.
public  Stringtrim()
     Answers a copy of this String with white space characters at the beginning and end removed.
public static  StringvalueOf(char[] data)
     Creates a new String containing the characters in the specified character array.
public static  StringvalueOf(char[] data, int start, int length)
     Creates a new String containing the specified characters in the character array.
public static  StringvalueOf(char value)
     Converts the specified character to its string representation.
public static  StringvalueOf(double value)
     Converts the specified double to its string representation.
public static  StringvalueOf(float value)
     Converts the specified float to its string representation.
public static  StringvalueOf(int value)
     Converts the specified integer to its string representation.
public static  StringvalueOf(long value)
     Converts the specified long to its string representation.
public static  StringvalueOf(Object value)
     Converts the specified object to its string representation.
public static  StringvalueOf(boolean value)
     Converts the specified boolean to its string representation.

Field Detail
CASE_INSENSITIVE_ORDER
final public static Comparator<String> CASE_INSENSITIVE_ORDER(Code)




Constructor Detail
String
public String()(Code)
Answers an empty string.



String
public String(byte[] data)(Code)
Converts the byte array to a String using the default encoding as specified by the file.encoding system property. If the system property is not defined, the default encoding is ISO8859_1 (ISO-Latin-1). If 8859-1 is not available, an ASCII encoding is used.
Parameters:
  data - the byte array to convert to a String
throws:
  NullPointerException - when data is null
See Also:   String.getBytes()
See Also:   String.getBytes(int,int,byte[],int)
See Also:   String.getBytes(String)
See Also:   String.valueOf(boolean)
See Also:   String.valueOf(char)
See Also:   String.valueOf(char[])
See Also:   String.valueOf(char[],int,int)
See Also:   String.valueOf(double)
See Also:   String.valueOf(float)
See Also:   String.valueOf(int)
See Also:   String.valueOf(long)
See Also:   String.valueOf(Object)



String
public String(byte[] data, int high)(Code)
Converts the byte array to a String, setting the high byte of every character to the specified value.
Parameters:
  data - the byte array to convert to a String
Parameters:
  high - the high byte to use
throws:
  NullPointerException - when data is null



String
public String(byte[] data, int start, int length)(Code)
Converts the byte array to a String using the default encoding as specified by the file.encoding system property. If the system property is not defined, the default encoding is ISO8859_1 (ISO-Latin-1). If 8859-1 is not available, an ASCII encoding is used.
Parameters:
  data - the byte array to convert to a String
Parameters:
  start - the starting offset in the byte array
Parameters:
  length - the number of bytes to convert
throws:
  IndexOutOfBoundsException - when length < 0, start < 0 orstart + length > data.length
throws:
  NullPointerException - when data is null
See Also:   String.getBytes()
See Also:   String.getBytes(int,int,byte[],int)
See Also:   String.getBytes(String)
See Also:   String.valueOf(boolean)
See Also:   String.valueOf(char)
See Also:   String.valueOf(char[])
See Also:   String.valueOf(char[],int,int)
See Also:   String.valueOf(double)
See Also:   String.valueOf(float)
See Also:   String.valueOf(int)
See Also:   String.valueOf(long)
See Also:   String.valueOf(Object)



String
public String(byte[] data, int high, int start, int length)(Code)
Converts the byte array to a String, setting the high byte of every character to the specified value.
Parameters:
  data - the byte array to convert to a String
Parameters:
  high - the high byte to use
Parameters:
  start - the starting offset in the byte array
Parameters:
  length - the number of bytes to convert
throws:
  IndexOutOfBoundsException - when length < 0, start < 0 orstart + length > data.length
throws:
  NullPointerException - when data is null



String
public String(byte[] data, int start, int length, String encoding) throws UnsupportedEncodingException(Code)
Converts the byte array to a String using the specified encoding.
Parameters:
  data - the byte array to convert to a String
Parameters:
  start - the starting offset in the byte array
Parameters:
  length - the number of bytes to convert
Parameters:
  encoding - the encoding
throws:
  IndexOutOfBoundsException - when length < 0, start < 0 orstart + length > data.length
throws:
  UnsupportedEncodingException - when encoding is not supported
throws:
  NullPointerException - when data is null
See Also:   String.getBytes()
See Also:   String.getBytes(int,int,byte[],int)
See Also:   String.getBytes(String)
See Also:   String.valueOf(boolean)
See Also:   String.valueOf(char)
See Also:   String.valueOf(char[])
See Also:   String.valueOf(char[],int,int)
See Also:   String.valueOf(double)
See Also:   String.valueOf(float)
See Also:   String.valueOf(int)
See Also:   String.valueOf(long)
See Also:   String.valueOf(Object)
See Also:   UnsupportedEncodingException



String
public String(byte[] data, String encoding) throws UnsupportedEncodingException(Code)
Converts the byte array to a String using the specified encoding.
Parameters:
  data - the byte array to convert to a String
Parameters:
  encoding - the encoding
throws:
  UnsupportedEncodingException - when encoding is not supported
throws:
  NullPointerException - when data is null
See Also:   String.getBytes()
See Also:   String.getBytes(int,int,byte[],int)
See Also:   String.getBytes(String)
See Also:   String.valueOf(boolean)
See Also:   String.valueOf(char)
See Also:   String.valueOf(char[])
See Also:   String.valueOf(char[],int,int)
See Also:   String.valueOf(double)
See Also:   String.valueOf(float)
See Also:   String.valueOf(int)
See Also:   String.valueOf(long)
See Also:   String.valueOf(Object)
See Also:   UnsupportedEncodingException



String
public String(char[] data)(Code)
Initializes this String to contain the characters in the specified character array. Modifying the character array after creating the String has no effect on the String.
Parameters:
  data - the array of characters
throws:
  NullPointerException - when data is null



String
public String(char[] data, int start, int length)(Code)
Initializes this String to contain the specified characters in the character array. Modifying the character array after creating the String has no effect on the String.
Parameters:
  data - the array of characters
Parameters:
  start - the starting offset in the character array
Parameters:
  length - the number of characters to use
throws:
  IndexOutOfBoundsException - when length < 0, start < 0 orstart + length > data.length
throws:
  NullPointerException - when data is null



String
String(int start, int length, char[] data)(Code)



String
public String(String string)(Code)
Creates a string that is a copy of another string
Parameters:
  string - the String to copy



String
public String(StringBuffer stringbuffer)(Code)
Creates a string from the contents of a StringBuffer.
Parameters:
  stringbuffer - the StringBuffer



String
public String(int[] codePoints, int offset, int count)(Code)

Constructs a String from the sub-array of Unicode code points.


Parameters:
  codePoints - The array of Unicode code points to convert.
Parameters:
  offset - The inclusive index into codePoints to beginconverting from.
Parameters:
  count - The number of element in codePoints to copy.
throws:
  NullPointerException - if codePoints is null.
throws:
  IllegalArgumentException - if any of the elements of codePoints are notvalid Unicode code points.
throws:
  IndexOutOfBoundsException - if offset or count are notwithin the bounds of codePoints.
since:
   1.5



String
public String(StringBuilder sb)(Code)

Constructs a String from a StringBuilder.


Parameters:
  sb - The StringBuilder to copy from.
throws:
  NullPointerException - if sb is null.
since:
   1.5




Method Detail
charAt
public char charAt(int index)(Code)
Answers the character at the specified offset in this String.
Parameters:
  index - the zero-based index in this string the character at the index
throws:
  IndexOutOfBoundsException - when index < 0 orindex >= length()



codePointAt
public int codePointAt(int index)(Code)

Retrieves the Unicode code point value at the index.


Parameters:
  index - The index to the char code unit within thisobject. The Unicode code point value.
throws:
  IndexOutOfBoundsException - if index is negative or greater than or equalto String.length().
See Also:   Character
See Also:   Character.codePointAt(char[]intint)
since:
   1.5



codePointBefore
public int codePointBefore(int index)(Code)

Retrieves the Unicode code point value that precedes the index.


Parameters:
  index - The index to the char code unit within thisobject. The Unicode code point value.
throws:
  IndexOutOfBoundsException - if index is less than 1 or greater thanString.length().
See Also:   Character
See Also:   Character.codePointBefore(char[]intint)
since:
   1.5



codePointCount
public int codePointCount(int beginIndex, int endIndex)(Code)

Calculates the number of Unicode code points between beginIndex and endIndex.


Parameters:
  beginIndex - The inclusive beginning index of the subsequence.
Parameters:
  endIndex - The exclusive end index of the subsequence. The number of Unicode code points in the subsequence.
throws:
  IndexOutOfBoundsException - if beginIndex is negative or greater thanendIndex or endIndex is greaterthan String.length().
since:
   1.5



compareTo
public int compareTo(String string)(Code)
Compares the specified String to this String using the Unicode values of the characters. Answer 0 if the strings contain the same characters in the same order. Answer a negative integer if the first non-equal character in this String has a Unicode value which is less than the Unicode value of the character at the same position in the specified string, or if this String is a prefix of the specified string. Answer a positive integer if the first non-equal character in this String has a Unicode value which is greater than the Unicode value of the character at the same position in the specified string, or if the specified String is a prefix of the this String.
Parameters:
  string - the string to compare 0 if the strings are equal, a negative integer if this String isbefore the specified String, or a positive integer if this Stringis after the specified String
throws:
  NullPointerException - when string is null



compareToIgnoreCase
public int compareToIgnoreCase(String string)(Code)
Compare the receiver to the specified String to determine the relative ordering when the case of the characters is ignored.
Parameters:
  string - a String an int < 0 if this String is less than the specified String, 0 ifthey are equal, and > 0 if this String is greater



concat
public String concat(String string)(Code)
Concatenates this String and the specified string.
Parameters:
  string - the string to concatenate a new String which is the concatenation of this String and thespecified String
throws:
  NullPointerException - if string is null



contains
public boolean contains(CharSequence cs)(Code)

Determines if this String contains the sequence of characters in the CharSequence passed.


Parameters:
  cs - The character sequence to search for. true if the sequence of characters are containedin this object; otherwise false
since:
   1.5



contentEquals
public boolean contentEquals(StringBuffer strbuf)(Code)
Answers whether the characters in the StringBuffer strbuf are the same as those in this String.
Parameters:
  strbuf - the StringBuffer to compare this String to true when the characters in strbuf are identical to those in thisString. If they are not, false will be returned.
throws:
  NullPointerException - when strbuf is null
since:
   1.4



contentEquals
public boolean contentEquals(CharSequence cs)(Code)

Compares a CharSequence to this String to determine if their contents are equal.


Parameters:
  cs - The character sequence to compare to. true if equal, otherwise false
since:
   1.5



copyValueOf
public static String copyValueOf(char[] data)(Code)
Creates a new String containing the characters in the specified character array. Modifying the character array after creating the String has no effect on the String.
Parameters:
  data - the array of characters the new String
throws:
  NullPointerException - if data is null



copyValueOf
public static String copyValueOf(char[] data, int start, int length)(Code)
Creates a new String containing the specified characters in the character array. Modifying the character array after creating the String has no effect on the String.
Parameters:
  data - the array of characters
Parameters:
  start - the starting offset in the character array
Parameters:
  length - the number of characters to use the new String
throws:
  IndexOutOfBoundsException - if length < 0, start < 0 orstart + length > data.length
throws:
  NullPointerException - if data is null



endsWith
public boolean endsWith(String suffix)(Code)
Compares the specified string to this String to determine if the specified string is a suffix.
Parameters:
  suffix - the string to look for true when the specified string is a suffix of this String, falseotherwise
throws:
  NullPointerException - if suffix is null



equals
public boolean equals(Object object)(Code)
Compares the specified object to this String and answer if they are equal. The object must be an instance of String with the same characters in the same order.
Parameters:
  object - the object to compare true if the specified object is equal to this String, falseotherwise
See Also:   String.hashCode



equalsIgnoreCase
public boolean equalsIgnoreCase(String string)(Code)
Compares the specified String to this String ignoring the case of the characters and answer if they are equal.
Parameters:
  string - the string to compare true if the specified string is equal to this String, falseotherwise



format
public static String format(String format, Object... args)(Code)
Returns a printf-style formatted string, using the supplied format and arguments. This function is a shortcut to format(Locale.getDefault(), format, args).
Parameters:
  format - a format string
Parameters:
  args - arguments to replace format specifiers, may be none
throws:
  NullPointerException - if the format is null
throws:
  IllegalArgumentException - if the format is invalid The formatted string
since:
   1.5
See Also:   java.util.Formatter



format
public static String format(Locale loc, String format, Object... args)(Code)
Returns a printf-style formatted string, using the supplied format and arguments, accordingly to the specified locale.
Parameters:
  loc - the locale to apply; null value means nolocalization
Parameters:
  format - a format string
Parameters:
  args - arguments to replace format specifiers, may be none
throws:
  NullPointerException - if the format is null
throws:
  IllegalArgumentException - if the format is invalid The formatted string
since:
   1.5
See Also:   java.util.Formatter



getBytes
public byte[] getBytes()(Code)
Converts this String to a byte encoding using the default encoding as specified by the file.encoding system property. If the system property is not defined, the default encoding is ISO8859_1 (ISO-Latin-1). If 8859-1 is not available, an ASCII encoding is used. the byte array encoding of this String
See Also:   String



getBytes
public void getBytes(int start, int end, byte[] data, int index)(Code)
Converts this String to a byte array, ignoring the high order bits of each character.
Parameters:
  start - the starting offset of characters to copy
Parameters:
  end - the ending offset of characters to copy
Parameters:
  data - the destination byte array
Parameters:
  index - the starting offset in the byte array
throws:
  NullPointerException - when data is null
throws:
  IndexOutOfBoundsException - whenstart < 0, end > length(), index < 0, end - start > data.length - index



getBytes
public byte[] getBytes(String encoding) throws UnsupportedEncodingException(Code)
Converts this String to a byte encoding using the specified encoding.
Parameters:
  encoding - the encoding the byte array encoding of this String
throws:
  UnsupportedEncodingException - when the encoding is not supported
See Also:   String
See Also:   UnsupportedEncodingException



getChars
public void getChars(int start, int end, char[] buffer, int index)(Code)
Copies the specified characters in this String to the character array starting at the specified offset in the character array.
Parameters:
  start - the starting offset of characters to copy
Parameters:
  end - the ending offset of characters to copy
Parameters:
  buffer - the destination character array
Parameters:
  index - the starting offset in the character array
throws:
  IndexOutOfBoundsException - when start < 0, end > length(),start > end, index < 0, end - start > buffer.length - index
throws:
  NullPointerException - when buffer is null



getValue
char[] getValue()(Code)



hashCode
public int hashCode()(Code)
Answers an integer hash code for the receiver. Objects which are equal answer the same value for this method. the receiver's hash
See Also:   String.equals



indexOf
public int indexOf(int c)(Code)
Searches in this String for the first index of the specified character. The search for the character starts at the beginning and moves towards the end of this String.
Parameters:
  c - the character to find the index in this String of the specified character, -1 if thecharacter isn't found
See Also:   String.lastIndexOf(int)
See Also:   String.lastIndexOf(int,int)
See Also:   String.lastIndexOf(String)
See Also:   String.lastIndexOf(String,int)



indexOf
public int indexOf(int c, int start)(Code)
Searches in this String for the index of the specified character. The search for the character starts at the specified offset and moves towards the end of this String.
Parameters:
  c - the character to find
Parameters:
  start - the starting offset the index in this String of the specified character, -1 if thecharacter isn't found
See Also:   String.lastIndexOf(int)
See Also:   String.lastIndexOf(int,int)
See Also:   String.lastIndexOf(String)
See Also:   String.lastIndexOf(String,int)



indexOf
public int indexOf(String string)(Code)
Searches in this String for the first index of the specified string. The search for the string starts at the beginning and moves towards the end of this String.
Parameters:
  string - the string to find the index in this String of the specified string, -1 if thestring isn't found
throws:
  NullPointerException - when string is null
See Also:   String.lastIndexOf(int)
See Also:   String.lastIndexOf(int,int)
See Also:   String.lastIndexOf(String)
See Also:   String.lastIndexOf(String,int)



indexOf
public int indexOf(String subString, int start)(Code)
Searches in this String for the index of the specified string. The search for the string starts at the specified offset and moves towards the end of this String.
Parameters:
  subString - the string to find
Parameters:
  start - the starting offset the index in this String of the specified string, -1 if thestring isn't found
throws:
  NullPointerException - when string is null
See Also:   String.lastIndexOf(int)
See Also:   String.lastIndexOf(int,int)
See Also:   String.lastIndexOf(String)
See Also:   String.lastIndexOf(String,int)



intern
public String intern()(Code)
Searches an internal table of strings for a string equal to this String. If the string is not in the table, it is added. Answers the string contained in the table which is equal to this String. The same string object is always answered for strings which are equal. the interned string equal to this String



lastIndexOf
public int lastIndexOf(int c)(Code)
Searches in this String for the last index of the specified character. The search for the character starts at the end and moves towards the beginning of this String.
Parameters:
  c - the character to find the index in this String of the specified character, -1 if thecharacter isn't found
See Also:   String.lastIndexOf(int)
See Also:   String.lastIndexOf(int,int)
See Also:   String.lastIndexOf(String)
See Also:   String.lastIndexOf(String,int)



lastIndexOf
public int lastIndexOf(int c, int start)(Code)
Searches in this String for the index of the specified character. The search for the character starts at the specified offset and moves towards the beginning of this String.
Parameters:
  c - the character to find
Parameters:
  start - the starting offset the index in this String of the specified character, -1 if thecharacter isn't found
See Also:   String.lastIndexOf(int)
See Also:   String.lastIndexOf(int,int)
See Also:   String.lastIndexOf(String)
See Also:   String.lastIndexOf(String,int)



lastIndexOf
public int lastIndexOf(String string)(Code)
Searches in this String for the last index of the specified string. The search for the string starts at the end and moves towards the beginning of this String.
Parameters:
  string - the string to find the index in this String of the specified string, -1 if thestring isn't found
throws:
  NullPointerException - when string is null
See Also:   String.lastIndexOf(int)
See Also:   String.lastIndexOf(int,int)
See Also:   String.lastIndexOf(String)
See Also:   String.lastIndexOf(String,int)



lastIndexOf
public int lastIndexOf(String subString, int start)(Code)
Searches in this String for the index of the specified string. The search for the string starts at the specified offset and moves towards the beginning of this String.
Parameters:
  subString - the string to find
Parameters:
  start - the starting offset the index in this String of the specified string, -1 if thestring isn't found
throws:
  NullPointerException - when string is null
See Also:   String.lastIndexOf(int)
See Also:   String.lastIndexOf(int,int)
See Also:   String.lastIndexOf(String)
See Also:   String.lastIndexOf(String,int)



length
public int length()(Code)
Answers the size of this String. the number of characters in this String



matches
public boolean matches(String expr)(Code)
Determines whether a this String matches a given regular expression.
Parameters:
  expr - the regular expression to be matched true if the expression matches, otherwise false
throws:
  PatternSyntaxException - if the syntax of the supplied regular expression is not valid
throws:
  NullPointerException - if expr is null
since:
   1.4



offsetByCodePoints
public int offsetByCodePoints(int index, int codePointOffset)(Code)

Returns the index within this object that is offset from index by codePointOffset code points.


Parameters:
  index - The index within this object to calculate the offset from.
Parameters:
  codePointOffset - The number of code points to count. The index within this object that is the offset.
throws:
  IndexOutOfBoundsException - if index is negative or greater thanString.length() or if there aren't enough code pointsbefore or after index to matchcodePointOffset.
since:
   1.5



regionMatches
public boolean regionMatches(int thisStart, String string, int start, int length)(Code)
Compares the specified string to this String and compares the specified range of characters to determine if they are the same.
Parameters:
  thisStart - the starting offset in this String
Parameters:
  string - the string to compare
Parameters:
  start - the starting offset in string
Parameters:
  length - the number of characters to compare true if the ranges of characters is equal, false otherwise
throws:
  NullPointerException - when string is null



regionMatches
public boolean regionMatches(boolean ignoreCase, int thisStart, String string, int start, int length)(Code)
Compares the specified string to this String and compares the specified range of characters to determine if they are the same. When ignoreCase is true, the case of the characters is ignored during the comparison.
Parameters:
  ignoreCase - specifies if case should be ignored
Parameters:
  thisStart - the starting offset in this String
Parameters:
  string - the string to compare
Parameters:
  start - the starting offset in string
Parameters:
  length - the number of characters to compare true if the ranges of characters is equal, false otherwise
throws:
  NullPointerException - when string is null



replace
public String replace(char oldChar, char newChar)(Code)
Copies this String replacing occurrences of the specified character with another character.
Parameters:
  oldChar - the character to replace
Parameters:
  newChar - the replacement character a new String with occurrences of oldChar replaced by newChar



replace
public String replace(CharSequence target, CharSequence replacement)(Code)
Copies this String replacing occurrences of the specified target sequence with another sequence. The string is processed from the beginning to the end.
Parameters:
  target - the sequence to replace
Parameters:
  replacement - the replacement sequence the resulting String
throws:
  NullPointerException - if either of the arguments is null



replaceAll
public String replaceAll(String expr, String substitute)(Code)
Replace any substrings within this String that match the supplied regular expression expr, with the String substitute.
Parameters:
  expr - the regular expression to match
Parameters:
  substitute - the string to replace the matching substring with the new string
throws:
  NullPointerException - if expr is null
since:
   1.4



replaceFirst
public String replaceFirst(String expr, String substitute)(Code)
Replace any substrings within this String that match the supplied regular expression expr, with the String substitute.
Parameters:
  expr - the regular expression to match
Parameters:
  substitute - the string to replace the matching substring with the new string
throws:
  NullPointerException - if expr is null
since:
   1.4



split
public String[] split(String expr)(Code)
Replace any substrings within this String that match the supplied regular expression expr, with the String substitute.
Parameters:
  expr - the regular expression to match the new string
throws:
  NullPointerException - if expr is null
since:
   1.4



split
public String[] split(String expr, int max)(Code)
Splits this String using the supplied regular expression expr. max controls the number of times that the pattern is applied to the string.
Parameters:
  expr - the regular expression used to divide the string
Parameters:
  max - the number of times to apply the pattern an array of Strings created by separating the string alongmatches of the regular expression.
throws:
  NullPointerException - if expr is null
since:
   1.4



startsWith
public boolean startsWith(String prefix)(Code)
Compares the specified string to this String to determine if the specified string is a prefix.
Parameters:
  prefix - the string to look for true when the specified string is a prefix of this String, falseotherwise
throws:
  NullPointerException - when prefix is null



startsWith
public boolean startsWith(String prefix, int start)(Code)
Compares the specified string to this String, starting at the specified offset, to determine if the specified string is a prefix.
Parameters:
  prefix - the string to look for
Parameters:
  start - the starting offset true when the specified string occurs in this String at thespecified offset, false otherwise
throws:
  NullPointerException - when prefix is null



subSequence
public CharSequence subSequence(int start, int end)(Code)
Has the same result as the substring function, but is present so that String may implement the CharSequence interface.
Parameters:
  start - the offset the first character
Parameters:
  end - the offset of one past the last character to include the subsequence requested
throws:
  IndexOutOfBoundsException - when start or end is less than zero, start is greater thanend, or end is greater than the length of the String.
See Also:   java.lang.CharSequence.subSequence(intint)
since:
   1.4



substring
public String substring(int start)(Code)
Copies a range of characters into a new String.
Parameters:
  start - the offset of the first character a new String containing the characters from start to the end ofthe string
throws:
  IndexOutOfBoundsException - when start < 0 orstart > length()



substring
public String substring(int start, int end)(Code)
Copies a range of characters into a new String.
Parameters:
  start - the offset of the first character
Parameters:
  end - the offset one past the last character a new String containing the characters from start to end - 1
throws:
  IndexOutOfBoundsException - when start < 0, start > end orend > length()



toCharArray
public char[] toCharArray()(Code)
Copies the characters in this String to a character array. a character array containing the characters of this String



toLowerCase
public String toLowerCase()(Code)
Converts the characters in this String to lowercase, using the default Locale. a new String containing the lowercase characters equivalent tothe characters in this String



toLowerCase
public String toLowerCase(Locale locale)(Code)
Converts the characters in this String to lowercase, using the specified Locale.
Parameters:
  locale - the Locale a new String containing the lowercase characters equivalent tothe characters in this String



toString
public String toString()(Code)
Answers a string containing a concise, human-readable description of the receiver. this String



toUpperCase
public String toUpperCase()(Code)
Converts the characters in this String to uppercase, using the default Locale. a new String containing the uppercase characters equivalent tothe characters in this String



toUpperCase
public String toUpperCase(Locale locale)(Code)
Converts the characters in this String to uppercase, using the specified Locale.
Parameters:
  locale - the Locale a new String containing the uppercase characters equivalent tothe characters in this String



trim
public String trim()(Code)
Answers a copy of this String with white space characters at the beginning and end removed. If the receiver has no leading or trailing blanks then it returns itself. Blanks are defined as characters with Unicode value <= \u0020. a new String with leading and trailing blanks removed, or thisstring if there are none.



valueOf
public static String valueOf(char[] data)(Code)
Creates a new String containing the characters in the specified character array. Modifying the character array after creating the String has no effect on the String.
Parameters:
  data - the array of characters the new String
throws:
  NullPointerException - when data is null



valueOf
public static String valueOf(char[] data, int start, int length)(Code)
Creates a new String containing the specified characters in the character array. Modifying the character array after creating the String has no effect on the String.
Parameters:
  data - the array of characters
Parameters:
  start - the starting offset in the character array
Parameters:
  length - the number of characters to use the new String
throws:
  IndexOutOfBoundsException - when length < 0, start < 0 orstart + length > data.length
throws:
  NullPointerException - when data is null



valueOf
public static String valueOf(char value)(Code)
Converts the specified character to its string representation.
Parameters:
  value - the character the character converted to a string



valueOf
public static String valueOf(double value)(Code)
Converts the specified double to its string representation.
Parameters:
  value - the double the double converted to a string



valueOf
public static String valueOf(float value)(Code)
Converts the specified float to its string representation.
Parameters:
  value - the float the float converted to a string



valueOf
public static String valueOf(int value)(Code)
Converts the specified integer to its string representation.
Parameters:
  value - the integer the integer converted to a string



valueOf
public static String valueOf(long value)(Code)
Converts the specified long to its string representation.
Parameters:
  value - the long the long converted to a string



valueOf
public static String valueOf(Object value)(Code)
Converts the specified object to its string representation. If the object is null answer the string "null", otherwise use toString() to get the string representation.
Parameters:
  value - the object the object converted to a string



valueOf
public static String valueOf(boolean value)(Code)
Converts the specified boolean to its string representation. When the boolean is true answer "true", otherwise answer "false".
Parameters:
  value - the boolean the boolean converted to a string



Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.