Android Question Regex B4A & B4J

Yes, same code, different behaviors.
It depends on the android version.
on a device ( all real device ) with:
Android 8 I have the 5 values (wrong)
Android 11 is fixed
Android 13 is fixed
 
Upvote 0
Found the answer on stackoverflow. The behavior when dealing with an empty String pattern has changed between Java 7 and Java 8. Depending on the version of Android, you may be dealing with Java 6, 7 or 8. This has nothing to do with the with the JDK you use in B4A to generate you APK, but with the Java implemented within Android.

This is the expected behavior for String#split for Java version up to 7 and has been changed in Java 8: Why in Java 8 split sometimes removes empty strings at start of result array?
– Tom
Jul 21, 2016 at 20:44
Source: https://stackoverflow.com/q/38513563 (see the comments)

 
Upvote 1

Similar Threads

  • Question Question
Android Question Regex text
Replies
2
Views
3K
  • Question Question
Android Question Regex.split
Replies
4
Views
3K
  • Question Question
Android Question Regex problem
Replies
18
Views
8K
  • Question Question
Android Question Regex split
Replies
2
Views
4K
Back
Top