At line 17 the code has used an index with the value -1 which is invalid. Valid indexes range in value from 0 to the length of the String -1. Look at line 17 and see why it is using an index of -1....
Type: Posts; User: Norm
At line 17 the code has used an index with the value -1 which is invalid. Valid indexes range in value from 0 to the length of the String -1. Look at line 17 and see why it is using an index of -1....
Can you make a small test program with a String that has the < and > and has the logic you are working with?
The FileWriter class isn't needed for debugging problems parsing a String.
That...
The String class has methods for finding Strings within another String. Use a method to Find the "<" and then find the ">".
You don't need to write anything to a file to test the String replacement logic.
Write a small test program
Define a String with the delimited Strings.
Write the logic to do the replacements....
Comment: Using a single letter like f for a variable name makes it hard to "Search" the source to see where the variable is used. A longer, unique name would make it easier.
Where is the...