I was writing a function in java which counts the number of characters after white spaces in a string. This problem might sound trivial to some of you.
publ
You don't need to declare a new variable:
for (; position<a.length; position++) count++;
You can leave any field of the for loop blank.
Or better yet, why not:
count = a.length - position;