I am trying to parse through HTML validation errors by adding the errors to an array, and then looping through the array, strip out the first part of the error (e.g. ValidationError line 23 col 40:) and then I want to only keep the text inside the single quotes and save that to a new list.
Here is what I have working, but I know it's not scalable and only works with the String fullText and not with the ArrayList list so that's what I need help with. Thank you!
package htmlvalidator;
import java.util.ArrayList;
public class ErrorCleanup {
public static void main(String[] args) {
//Saving the raw errors to an array list
ArrayList<String> list = new ArrayList<String>();
//Add the text to the first spot
list.add("ValidationError line 23 col 40:'Bad value ius-cors for attribute name on element meta: Keyword ius-cors is not registered.'");
//Show what is in the list
System.out.println("The full error message is: " + list);
String fullText = "ValidationError line 23 col 40:'Bad value ius-cors for attribute name on element meta: Keyword ius-cors is not registered.'";
//Show just the actual message
System.out.println("The actual error message is: " + fullText.substring(fullText.indexOf("'") + 1));
}
}