Showing posts with label string. Show all posts
Showing posts with label string. Show all posts

Wednesday, January 11, 2017

Java Count Number of Words in String

In this post, I will show you How to count number of Words in the String. It's easy via array and string class. For example : "Hello World" Result : 2. Coding: public class StringDemo { static int i,c=0,res; static int wordcount(String s) { char...
Share:

Java Difference between String, StringBuffer and String Builder

In this post, I will show you The difference between String, StringBuffer and String Builder. As you will find that there are minor differences between the above classess. ...
Share:

Total Pageviews