• 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 […]

  • How to find location of word and character from string?

    In this blog, we will see how to find location of word and character from string. We will use indexOf() and lastIndexOf method. Both methods will return location of word and character. How to find location of word and character from string program class str5 {                 public static void main(String args[])                 {                                 […]

  • How to check string from front and back?

    How to check string using startsWith and endsWith function? Let’s see videos and program on how to check string using endsWith and startsWith function. In this blog, we will check string from front and back part. startsWith() and endsWith() functions work on check string.   Video On endsWith and startsWith Function   class str4 { […]