How do I add </in> to the end of each line?
A String contain:
<ch>13</ch><in>Item 13(mono)
<ch>14</ch><in>Item 14(mono)
<ch>15</ch><in>Item 15(mono)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To replace each line break with
</in>and a line break, you could try something like this:But if the strings contains the extra white space, extra empty lines, in your example, you would probably end up with an extra
</in>there too. So to get valid XML, you would probably have to do more than the above.