Separator in String in java

You are given with a string along with delimiter such as ")" ,"(" , "}" ,"{" ,"[" , "]" should be replaced and saved as next element in array. Whereas delimiter is doubled "))" should be replaced with ")" of that respective delimiter.




Input
abc(e))df)

Output:
abc
e)df

Input:
abc(efg)hij{lmn}

Output:
abc
efg
hij
lmn

Comments

Popular posts from this blog

Reasoning-Number Series

Reasoning-Letter Series

Profit and Loss