How to add text temporarly for contains using ArrayList? Java : ##Summary##
I am developing a programming language in Java (using Eclipse). For my compiler, I split the text the user inputs in using the character ";", then converts the list to an ArrayList. It then goes through each line in the ArrayList, and checks what it is doing.
##The Problem?##
When it breaks it down into multiple lines, there is a "\n" at the beginning of the line because each line of code is on it's own line.

I am doing somethings with calling functions using variables, for example,

    container.callFunction();

So I have to figure out is "container" is a variable. I have an ArrayList of all the variables created while running the code. So in the ArrayList containing variables, called "variables", is the string "container". But when my compiler breaks the lines down, it ends up with "\ncontainer", then I use the ArrayList.contains() method to confirm the item is a variable. But in variables, there is "container", but no "\ncontainer".

I know a solution to this, but I just don't exactly know how to do it. I could add the "\n" to the beginning of the variables array temporarily for the .contains() method. Does any one know how to do that, or have a better solution to this?