I need to change the order of my string to the Expected value. And also the ',' should get match according to my expected.
String actual = "10684 ANNA MARIE DR, GLEN ALLEN, VA, APT 111, 23060";
String expected = "10684 ANNA MARIE DR, APT 111, GLEN ALLEN, VA 23060";
So that, I can assert the result like this
Assert.assertEquals(actual,expected);
Any help would be greatly appreciated.
actualstrings always in the same order? Or can they have any order? And do you want to rearrange them just to be able to compare them or is it enough to actually know whether they do contain the same information? For two out of three of those cases, you already have answers available.