Android Word Count getWordCount(String str)

Here you can find the source of getWordCount(String str)

Description

get Word Count

License

Apache License

Declaration

public static int getWordCount(String str) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int getWordCount(String str) {
        str = str.replaceAll(" [^\\x00-\\xff] ", " ** ");
        int length = str.length();
        return length;
    }// w w w  .  ja v a2 s  .c  o  m
}