How to validate multiple line text

How to validate multiple line text in appium?
actual string is shown as two lines in the application and assertion is failed while validating the string using assertEquals. Currently using \n for expected string as work around.

Use contains instead of exact text.

If you are content with the string data you read from the device and believe it’s format is correct, you may try to validate the two strings with String class and use the return value with assertTrue.

Link below mentions assertEquals(Obj, Obj) does the same thing with String.equals(""), so maybe you can check if you are using assertEquals(Obj) instead of assertEquals(char [])

(And does “\n” stays the same with different device sizes? It might move or dissapear completely if there is enough space for 1 line)