[Java] Validate opening & closing character pattern in text | About Publisher

[Java] Validate opening & closing character pattern in text

How to validate the format of a given string according to a given set of opening-closing character pairs? This has been raised as an interview question, so I thought of writing a simple program to solve this.

Let me elaborate the question. There are characters that are considered as opening characters and closing characters; when '(' is an opening character, the relevant closing character is ')' For example; ([]) is correctly formatted, but ([) is not. So your task is to find out whether all the starting characters are properly ended with a ending character. Read more �
Share this article please, on :
Share on fb Tweet Share on G+

0 Response to "[Java] Validate opening & closing character pattern in text"

Post a Comment