I have read few questions about parsing string by tags, but I didn't find the exaact answer for my specific problem. The Problem: I have a big line of text.I need to parse this string into multiple ones based on the tags. Exmaple: I find [tag] then I read the text until the [tag] and get it to a new string. Then I read the text before same [tag] appears, and post this data to a new string, and so on.
Example: [tag] Lorem Ipsum [tag] is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. [tag] It has [tag] survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
I want three string based on this text: Lorem Ipsum, It has, text between this
Regular expressions to the rescue!
Alternatively you could just go through the String manually.
Use split method of String class. It expects regular expression as a parameter: