Finding a sub string on given string

indexOf(String str) return int value that is the index value of str if found in string other wise it returns -1.The index value start from 0. contains(CharSequence str) returns boolean value if str is present in given string it will return true else false.

Concatenating two strings

The + operator can be used for concatenation of strings. concat(String str) is a method of String class that concatenate two strings and return a String.

String matching and comparing

equals(Object anObject) compare String with object and returns boolean value, for comparing two strings if both are strictly equals(case sensitive) then it will return true else false value. equalsIgnoreCase(String anotherString) compare two strings with case ignorance and return boolean value. compareTo(String anotherString) compare two strings and return int value if both are equal(with case) … Read more

Converting given string to upper and lower case

toUpperCase() and toLowerCase() are methods in String class which converts given string in upper and lower case respectively and return a string.

Sending mail using java mail API

for this java mail api should be present on your class path.

Splitting the strings in words

Counting the number of characters and words in given string