count specific characters from text code example
Example 1: how to count number of words in a string
String name = "Carmen is a fantastic play"; //arbitrary sentence
int numWords = (name.split("\\s+")).length; //split string based on whitespace
//split returns array - find legth of array
System.out.println(numWords);
Example 2: How to check a string for specific characters?
if '$' in myString: