I can't get useDelimiter to cooperate
I am working on a Java project and I am trying to get useDelimiter to remove everything except the text in between "=" and ",". For example, on the first line of the file I would like to keep "ThermostatNight".
This is what the text file looks like:
I've been able to do the exact opposite using this code:
Is there any way I can tweak this to do the opposite?
Re: I can't get useDelimiter to cooperate
Please provide more information on your project (preferably an SSCCE), as we can only guess what the useDelimiter method refers to. I'm in a guessing mood so I'll take a shot: you are referring to the Scanner method useDelimiter, in which case this is the delimiter. If you wish to capture groups and have more fine tuned parsing, I recommend reading Lesson: Regular Expressions (The Java™ Tutorials > Essential Classes). You could also use the methods of the String class to accomplish a same task