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

Commit 76e05493 authored by Jun Yin's avatar Jun Yin Committed by android-build-merger
Browse files

Merge "Adds stripTrailingFs" am: 27bb333e

am: a91491a3

Change-Id: I6b850d252fb40395bc312f4ed8be383153af52ef
parents fd8df823 a91491a3
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -836,6 +836,13 @@ public class IccUtils {
        return new String(new char[] {HEX_CHARS[(b & 0xFF) >>> 4], HEX_CHARS[b & 0xF]});
    }

    /**
     * Strip all the trailing 'F' characters of a string, e.g., an ICCID.
     */
    public static String stripTrailingFs(String s) {
        return s == null ? null : s.replaceAll("(?i)f*$", "");
    }

    /**
     * Converts a character of [0-9a-aA-F] to its hex value in a byte. If the character is not a
     * hex number, 0 will be returned.