P
P
poet peselnik2018-03-26 18:43:28
Java
poet peselnik, 2018-03-26 18:43:28

How to find a string between characters?

Hello everyone, please help me to solve the problem.
It is necessary to determine if the string has opening brackets at the beginning and closing brackets at the end, then you need to take the text between them. And if the brackets are not closed or they do not exist at all, or do not open, then return the entire string.
That is, in such a string "(hello)" or "(((hello)))" you must return hello, and in such a string "hel(lo)" return hel(lo).
Please help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question