I am currently working on a project that involves using Weka to classify headlines based on their crime type. Since Weka uses .arff files, any headline with an apostrophe in it must be escaped.

```
List<String> headlines = demoPipe.getHeadlines();
    for (int i = 0; i < headlines.size(); i++) {

        if(headlines.get(i).contains("'"))
            headlines.get(i).replace("'", "\\'");

        System.out.println(headlines.get(i));

        //System.out.printf("'%s'%n", headline);
    }

```

The if statement is where I'm trying to escape the apostrophes, however when I print out the headlines, any headlines with apostrophes remain unchanged. How can I fix this issue?