String in = "dr. goldberg offers everything i look for in a general practitioner. he's nice and easy to talk to without being patronizing; he's always on time in seeing his patients; he's affiliated with a top-notch hospital (nyu) which my parents have explained to me is very important in case something happens and you need surgery; and you can get referrals to see specialists without having to see him first. really, what more do you need? i'm sitting here trying to think of any complaint\n\ns i have about him, but i'm really drawing\n a blank.";
This code seems to be working perfectly fine.
in = in.replaceAll("\n", "");
but this
for(String temp: review){
String reviews = (StringUtils.substringBetween(temp,"\"text\": \"", "\", \"type\"")).replaceAll("\n", "");
if(reviews.equals(in)){
System.out.println("yes");
System.exit(1);
}
}
does not seem to work. It is not removing new line constant, Can someone please explain why!
(I am using substringBetween to get a part of text from a file)