I've been searching a way to replace all literal \n occurrences by something else and it is driving me nuts all morning. note: It needs to be done in java (for a library), not B4J
Result: this \n is a test
Expected: this ABA is a test
Same happens in pure java in my library.
B4X:
Private NativeMe As JavaObject
NativeMe = Me
Dim s As String = NativeMe.RunMethod("test", Array As String("this \n is a test"))
Log(s)
B4X:
public String test(String s) {
return s.replaceAll("\\n", "ABA");
}
Result: this \n is a test
Expected: this ABA is a test
Same happens in pure java in my library.