Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa4d7754 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Combine list of CharSequence with delimeter.

Change-Id: I7d86b89a84f6d91e5441c8af63310b37f16974fc
parent b51645ee
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -258,6 +258,17 @@ public class TextUtils {
        return ret;
    }

    /**
     * Returns list of multiple {@link CharSequence} joined into a single
     * {@link CharSequence} separated by localized delimiter such as ", ".
     *
     * @hide
     */
    public static CharSequence join(Iterable<CharSequence> list) {
        final CharSequence delimiter = Resources.getSystem().getText(R.string.list_delimeter);
        return join(delimiter, list);
    }

    /**
     * Returns a string containing the tokens joined by delimiters.
     * @param tokens an array objects to be joined. Strings will be formed from
+3 −0
Original line number Diff line number Diff line
@@ -3127,4 +3127,7 @@
    <!-- Description of for the status bar's icon that the device is locked for accessibility. [CHAR LIMIT=NONE] -->
    <string name="status_bar_device_locked">Device locked.</string>

    <!-- Delimeter used between each item in a textual list; for example "Alpha, Beta". [CHAR LIMIT=3] -->
    <string name="list_delimeter">", "</string>

</resources>