Java String indexOf() method

Java String indexOf() method returns index of a given character or substring present in a String.                  Methods                                                  Description int indexOf(int ch)   It returns index position for the given char value. int...

Java String getChars() Method

Java String getChars() method copies characters from current String to the destination character array . Syntax: public void getChars(int <em>srcBeginIndex</em>, int <em>srcEndIndex</em>, char[] destination, int...

Java String getBytes() method

getBytes() method returns sequence of bytes. Syntax: There are three variants of getBytes() method: public byte[] getBytes()        public byte[] getBytes(String charsetName) public byte[] getBytes(Charset charset) 123456  There are three variants of getBytes()...

Java String format() method

format() method returns a formatted String based on the given locale,specified format and arguments. Syntax: public static String format(String format , Object… args) 123  public static String format(String format , Object… args)  Parameter: locale :  It...

Java String equalsIgnoreCase() method

equalsIgnoreCase() method compares two Strings based on the their content but ignore the case. Syntax  public boolean equalsIgnoreCase(Objects anObject) 123  public boolean equalsIgnoreCase(Objects anObject)  Parameter anObject: Object to be compared with...

Java String equals() method

equals() method compares two string based on the their content. Syntax public boolean equals(Objects anObject) 123  public boolean equals(Objects anObject)  parameter anObject: Object to be compared with the current String. Returns It returns true when the...

Java String endsWith() method

Checks whether this String ends with the specified suffix or not. Syntax public boolean endsWith(String Suffix) 123  public boolean endsWith(String Suffix)  Parameter Suffix : It takes suffix as a parameter  i.e. Sequence of characters Returns It returns...

Java String contains() method

contains() method returns true only if it contains the given sequence of  characters otherwise it returns false. syntax: public boolean contains(CharSequence sequence) 123  public boolean contains(CharSequence sequence)  parameters: sequence : It is the...

Java String concat() method:

Java String concat() method is used to add the given String to the end of the current String. Syntax: public String concat(String str) 123  public String concat(String str)  Parameter: Str: String to be concatenated at the end of current string. Returns: It...

Pin It on Pinterest