Suppose there is a text:
String s = "Pater noster, qui es in caelis; sanctificetur nomen tuum; adveniat regnum tuum; fiat { voluntas tua, sicut in caelo et in terra. Panem nostrum quotidianum da nobis hodie; et dimitte nobis debita nostra, sicut et nos dimittimus debitoribus nostris } ; et ne nos inducas { in tentationem; sed libera nos } a malo. Amen" It is necessary to “enter” it after the symbol { , replace all in with el if they exist and “exit” if the } character is encountered and continue further in the text with the same condition.