Write your program and if you are having a problem post it here with a description of the problem you are having. What you are asking is for someone to do your homework for you.
Java solution:.
// Let's assume you want to search for all square brackets [] public static int getBracketCount(final String str) { int bracketCount = 0; // Iterate through each character in str. for...