OpenJDK 11: Merging in java.lang.String (strip*() methods)

This is part of merging upstream changes from OpenJDK 11.28. This CL
adds strip(), stripLeading() and stripTrailing() methods; and adds
unit tests for them.

Note that these methods make use of newly added StringUTF16
package-private class that contains implementation of those methods and
their helpers.

Upstream has two satellite classes: StringUTF16 and StringLatin1 which
have the same purpose of containing implementation of some methods, for
uncompressed and compressed strings, respectively.

In libcore we choose to import only StringUTF16 (omitting StringLatin1)
as libcore implements most of the methods in String class with
String#charAt(int) and other primitives which all do not have access to
underlying character arrays (as those are managed by ART). Since that,
the difference between upstream and libcore is less when StringUTF16 is
used (StringLatin1 uses direct character array access in most cases and
not useful in this case).

Bug: 202962059
Test: atest CtsLibcoreOjTestCases:test.java.lang.String.Strip
Change-Id: I14c948e165fef636cb9e2a2a479893247f736015
7 files changed