• StringBuffer Functions with examples

    In our last blog, we understand different and similarity of String Functions and StringBuffer Functions. In this blog, we will see example of StringBuffer class and functions.   List of StringBuffer Functions Functions Function’s Work reverse() To reverse String setCharAt(int,char) To replace index character insert(int,String) To add extra string in index append() To join two […]

  • Similarity and Different between String and StringBuffer Class

    In this blog, we will see similarity and different between String and StringBuffer Class. Similarity of String and StringBuffer Class String Functions StringBuffer Function length() length() charAt() charAt() getChars() getChars() replace() replace() substring() substring() indexOf() indexOf() lastIndexOf() lastIndexOf() String s1 = new String(“demo Text”); StringBuffer s1 = new StringBuffer(“demo Text”);   Above table mention all […]

  • Java getChars method with getBytes method

    Java getChars method stores string data into character array. We can copy all string and also part of string. Java getBytes method stores string data into byte array. We can find ASCII code from this function.   Let’s see example on java getChars method   class str8 {                 public static void main(String args[])                 […]

  • Java substring method

    Java substring method maximum use in advance and basic level java programs. In my website creation many time use substring() function to find proper data from string.   2 types of substring() method available in java string program substring(int) In this method, output will be start index(int) to entire left string substring(int,int) In this method, […]

  • Java toString method

    In this blog, we will see java toString method with example. Most of the developer use toString() method for program testing. Statement of toString method public String toString() {             return string_value; } Public is compulsory in this statement Return type is String class   Let’s see example on java toString method   class Employee […]