Java String Api example program


All Implemented Interfaces:
            Serializable, Comparable, CharSequence

Since:
            JDK1.0

Important String methods:

   Java String example to concatenate two strings using concat

   Java String example to find char by its index position using charAt

   Java String example to convert char array to String using copyValueOf

   Java String example to encode given string to byte array using getBytes

   Java String example to check whether the string ends with given suffix using endsWith

   Java String example to check whether the given regex matches in a string using matches

   Java String example to compare two strings lexicographically using compareTo

   Java String example to compare two string in dictionary order ignoring cases using compareToIgnoreCase

   Java String example to compare two string using equals

  Java String example to compare equality of two string Ignoring case using equalsIgnoreCase

  Java String example to check whether the given char sequence is found in the string using contains

  Java String example to check whether the given char sequence is equal to string using contentEquals

  Java String example to retrieve the index position of a character from the last int using     lastIndexOf

  Java String example to retrieve the index position of a character from given position using lastIndexOf

  Java String example to retrieve the index position of given string using indexOf

  Java String example to retrieve the index position of given character using indexOf

  Java String example to retrieve the index position of a char from the specified index using indexOf

  Java String example to check whether a given string is empty or not using isEmpty

  Java String example to get HashCode of a given string using hashCode

  Java String example to replace a character with new character using replace

  Java String example to replace all String matches the given regex String using replaceAll




Related Post

Comments


©candidjava.com