java substring example

substring() String Example

Many methods exist in java.lang.String class used for different string manipulations like checking the availability of a character, to extract a part of a string or to convert a data type to string etc. The present method is substring() String. substring(int) and substring(int, int) extracts part of a string. substring()…

StringBuffer substring Java Pass By Reference

StringBuffer substring Java Pass By Reference Many petty methods exist with StringBuffer like substring(), setLength() and trimToSize() etc. These methods are not much used in regular programming.

Output screen of MiscellaneousMethods.java of StringBuffer substring Java Pass By Reference substring() method works the same way of strings. setLength() and trimTosize()…