how to find the number of words present in a string which may contain more than 1 blanks between two words and may have leading or tailing blanks.

example:--- my name is abhishek sharma .